From 5113bdffd0d17cb40bb0917d80128de9ded94730 Mon Sep 17 00:00:00 2001 From: unknown 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. mysql-test/r/create.result: BUG#5390 - problems with merge tables Removed a duplicate test. mysql-test/r/merge.result: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT Added test results. mysql-test/t/create.test: BUG#5390 - problems with merge tables Removed a duplicate test. mysql-test/t/merge.test: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT Added tests. sql/lock.cc: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 5.0. Added a new function to find a duplicate lock in a list of tables. sql/mysql_priv.h: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 5.0. Added the thread handle to unique_table(). Added a declaration for the new function. sql/sql_base.cc: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 5.0. Added the thread handle to unique_table(). Added a call to the new mysql_lock_have_duplicate(), which needs the thread handle, to unique_table(). sql/sql_delete.cc: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 5.0. Added the thread handle to unique_table(). sql/sql_insert.cc: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 5.0. Added the thread handle to unique_table(). sql/sql_load.cc: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 5.0. Added the thread handle to unique_table(). sql/sql_parse.cc: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 5.0. Added the thread handle to unique_table(). sql/sql_update.cc: BUG#5390 - problems with merge tables Problem #1: INSERT...SELECT, Version for 5.0. Added the thread handle to unique_table(). Replaced a call to find_table_in_local_list() by the newly extended unique_table(). --- sql/sql_insert.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_insert.cc') diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 8903f28be11..e4d70e8f1bb 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -870,7 +870,7 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, { Item *fake_conds= 0; 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, "INSERT", duplicate); DBUG_RETURN(TRUE); @@ -2171,7 +2171,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) query */ if (!(lex->current_select->options & OPTION_BUFFER_RESULT) && - unique_table(table_list, table_list->next_global)) + unique_table(thd, table_list, table_list->next_global)) { /* Using same table for INSERT and SELECT */ lex->current_select->options|= OPTION_BUFFER_RESULT; -- cgit v1.2.1