1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +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
This commit is contained in:
bell@sanja.is.com.ua
2005-08-02 22:54:49 +03:00
parent c9de0b15f2
commit 4c69fbe632
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;
}