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
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

@ -778,10 +778,14 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
if (!table)
table= table_list->table;
if (!select_insert && unique_table(table_list, table_list->next_global))
if (!select_insert)
{
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name);
DBUG_RETURN(TRUE);
TABLE_LIST *duplicate;
if ((duplicate= unique_table(table_list, table_list->next_global)))
{
update_non_unique_table_error(table_list, "INSERT", duplicate);
DBUG_RETURN(TRUE);
}
}
if (duplic == DUP_UPDATE || duplic == DUP_REPLACE)
table->file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY);