1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

issue correct error message in case of view presence for duplicated table on update (BUG#10773)

frequently used command sequence replaced with inline function


BitKeeper/etc/config:
  logging switching off
mysql-test/r/lowercase_view.result:
  hided view underlying tables from error message
mysql-test/r/view.result:
  hided view underlying tables from error message
mysql-test/t/lowercase_view.test:
  hided view underlying tables from error message
mysql-test/t/view.test:
  hided view underlying tables from error message
sql/mysql_priv.h:
  subroutine which return correct error message
sql/share/errmsg.txt:
  new error message
sql/sql_base.cc:
  subroutine which issue correct error message in case of view presence for duplicated table on update
sql/sql_delete.cc:
  issue correct error message in case of view presence for duplicated table on update
sql/sql_insert.cc:
  issue correct error message in case of view presence for duplicated table on update
sql/sql_parse.cc:
  issue correct error message in case of view presence for duplicated table on update
sql/sql_update.cc:
  issue correct error message in case of view presence for duplicated table on update
sql/sql_view.cc:
  frequently used command sequence replaced with inline function
sql/table.cc:
  frequently used command sequence replaced with inline function
sql/table.h:
  frequently used command sequence replaced with inline function
This commit is contained in:
unknown
2005-08-02 22:54:49 +03:00
parent b80eb2b5a8
commit 705118d1f6
15 changed files with 293 additions and 190 deletions

View File

@ -2845,12 +2845,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)
@ -2860,9 +2863,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;
}