MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:December 13 2010 9:39am
Subject:Re: bzr commit into mysql-trunk branch (Li-Bing.Song:3207) WL#5576
View as plain text  
Hi Libing,

On 11/25/10 7:29 AM, Li-Bing.Song@stripped wrote:
> #At file:///home/anders/Work/bzrwork/wt1/mysql-trunk-wl5576/ based on
> revid:alexander.nozdrin@stripped
>
>   3207 Li-Bing.Song@stripped	2010-11-25
>        WL#5576 Prohibit CREATE TABLE ... SELECT to modify other tables
>
>        Implementation of the worklog.

Please, briefly describe the problem and the solution being implemented.

[..]

>
> === modified file 'sql/share/errmsg-utf8.txt'
> --- a/sql/share/errmsg-utf8.txt	2010-11-15 16:43:41 +0000
> +++ b/sql/share/errmsg-utf8.txt	2010-11-25 09:29:16 +0000
> @@ -5556,7 +5556,7 @@ ER_DATETIME_FUNCTION_OVERFLOW 22008
>           eng "Datetime function: %-.32s field overflow"
>           ger "Datetime-Funktion: %-.32s Feldüberlauf"
>   ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
> -        eng "Can't update table '%-.192s' in stored function/trigger because it is
> already used by statement which invoked this stored function/trigger."
> +        eng "Can't update table '%-.192s' in stored function/trigger because it is
> already used by statement which invoked this stored function/trigger or it is in a CREATE
> TABLE statement."

This message does not quite explain the case where the table being 
updated is not the same being created. For example, table t1 is being 
created but table t2 is being updated in the function.

Also, it would be better to introduce a new error message, let's not 
overload the meaning of this one. Please check with the docs team (#docs 
on IRC) what message would be appropriate.

>           ger "Kann Tabelle '%-.192s' in gespeicherter Funktion oder Trigger nicht
> aktualisieren, weil sie bereits von der Anweisung verwendet wird, die diese gespeicherte
> Funktion oder den Trigger aufrief"
>   ER_VIEW_PREVENT_UPDATE
>           eng "The definition of table '%-.192s' prevents operation %.192s on table
> '%-.192s'."
>
> === modified file 'sql/sql_parse.cc'
> --- a/sql/sql_parse.cc	2010-11-15 16:43:41 +0000
> +++ b/sql/sql_parse.cc	2010-11-25 09:29:16 +0000
> @@ -2454,7 +2454,7 @@ case SQLCOM_PREPARE:
>         if (!(res= open_and_lock_tables(thd, lex->query_tables, TRUE, 0)))
>         {
>           /* The table already exists */
> -        if (create_table->table)
> +        if (create_table->table || create_table->view)
>           {

Otherwise, looks good.

Regards,

Davi
Thread
bzr commit into mysql-trunk branch (Li-Bing.Song:3207) WL#5576Li-Bing.Song25 Nov
  • Re: bzr commit into mysql-trunk branch (Li-Bing.Song:3207) WL#5576Daogang Qu7 Dec
  • Re: bzr commit into mysql-trunk branch (Li-Bing.Song:3207) WL#5576Davi Arnaut13 Dec
    • Re: bzr commit into mysql-trunk branch (Li-Bing.Song:3207) WL#5576Libing Song16 Dec