diff options
author | unknown <bell@sanja.is.com.ua> | 2005-09-01 22:42:37 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-09-01 22:42:37 +0300 |
commit | a8fc85cbe338787214be1afc91e5760c6b81632a (patch) | |
tree | d788943a464c45d6c90828c3d67021e7b0e2d4b9 /sql/sql_parse.cc | |
parent | a2d8ab0bb5fe8edaaea8637bf8d9d78548dd5a21 (diff) | |
parent | eb7c4ff2dbcfcc0292dcd1ff577b1d203463834c (diff) | |
download | mariadb-git-a8fc85cbe338787214be1afc91e5760c6b81632a.tar.gz |
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0
BitKeeper/etc/config:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.h:
Auto merged
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 923a00decae..f572b1d9122 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2855,12 +2855,15 @@ mysql_execute_command(THD *thd) Is table which we are changing used somewhere in other parts of query */ - if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) && - unique_table(create_table, select_tables)) + if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) { - my_error(ER_UPDATE_TABLE_USED, MYF(0), create_table->table_name); - res= 1; - goto end_with_restart_wait; + TABLE_LIST *duplicate; + if ((duplicate= unique_table(create_table, select_tables))) + { + update_non_unique_table_error(create_table, "CREATE", duplicate); + res= 1; + goto end_with_restart_wait; + } } /* If we create merge table, we have to test tables in merge, too */ if (lex->create_info.used_fields & HA_CREATE_USED_UNION) @@ -2870,9 +2873,10 @@ mysql_execute_command(THD *thd) tab; tab= tab->next_local) { - if (unique_table(tab, select_tables)) + TABLE_LIST *duplicate; + if ((duplicate= unique_table(tab, select_tables))) { - my_error(ER_UPDATE_TABLE_USED, MYF(0), tab->table_name); + update_non_unique_table_error(tab, "CREATE", duplicate); res= 1; goto end_with_restart_wait; } |