From b0e84cb99913024ca6a1b1023c859e3ba2b7bac5 Mon Sep 17 00:00:00 2001 From: "ingo@mysql.com" <> Date: Tue, 20 Dec 2005 16:35:05 +0100 Subject: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 5.0. Extended the unique table check by a check of lock data. Merge sub-tables cannot be detected by doing name checks only. --- sql/sql_update.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sql/sql_update.cc') diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 94c00036540..e38848bc821 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -616,7 +616,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list, /* Check that we are not using table that we are updating in a sub select */ { TABLE_LIST *duplicate; - if ((duplicate= unique_table(table_list, table_list->next_global))) + if ((duplicate= unique_table(thd, table_list, table_list->next_global))) { update_non_unique_table_error(table_list, "UPDATE", duplicate); my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name); @@ -839,7 +839,7 @@ reopen_tables: tl->lock_type != TL_READ_NO_INSERT) { TABLE_LIST *duplicate; - if ((duplicate= unique_table(tl, table_list))) + if ((duplicate= unique_table(thd, tl, table_list))) { update_non_unique_table_error(table_list, "UPDATE", duplicate); DBUG_RETURN(TRUE); @@ -1026,8 +1026,7 @@ int multi_update::prepare(List ¬_used_values, { TABLE *table=table_ref->table; if (!(tables_to_update & table->map) && - find_table_in_local_list(update_tables, table_ref->db, - table_ref->table_name)) + unique_table(thd, table_ref, update_tables)) table->no_cache= 1; // Disable row cache } DBUG_RETURN(thd->is_fatal_error != 0); -- cgit v1.2.1