From: ingo Date: December 27 2005 9:31am Subject: bk commit into 5.0 tree (ingo:1.2005) List-Archive: http://lists.mysql.com/commits/423 Message-Id: Below is the list of changes that have just been committed into a local 5.0 repository of mydev. When mydev does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2005 05/12/27 10:31:00 ingo@stripped +7 -0 Merge mysql.com:/home/mydev/mysql-5.0 into mysql.com:/home/mydev/mysql-5.0-bug5390 sql/sql_update.cc 1.182 05/12/27 10:30:50 ingo@stripped +0 -0 Auto merged sql/sql_parse.cc 1.519 05/12/27 10:30:49 ingo@stripped +0 -0 Auto merged sql/sql_insert.cc 1.181 05/12/27 10:30:49 ingo@stripped +0 -0 Auto merged sql/sql_delete.cc 1.171 05/12/27 10:30:49 ingo@stripped +0 -0 Auto merged sql/sql_base.cc 1.320 05/12/27 10:30:49 ingo@stripped +0 -0 Auto merged sql/mysql_priv.h 1.372 05/12/27 10:30:49 ingo@stripped +0 -0 Auto merged BitKeeper/deleted/.del-ha_blackhole.cc~727c69ef7846623a 1.4 05/12/27 10:30:49 ingo@stripped +0 -0 Auto merged # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: ingo # Host: chilla.local # Root: /home/mydev/mysql-5.0-bug5390/RESYNC --- 1.371/sql/mysql_priv.h 2005-12-12 13:24:01 +01:00 +++ 1.372/sql/mysql_priv.h 2005-12-27 10:30:49 +01:00 @@ -986,7 +986,7 @@ uint offset_to_list, const char *db_name, const char *table_name); -TABLE_LIST *unique_table(TABLE_LIST *table, TABLE_LIST *table_list); +TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list); TABLE **find_temporary_table(THD *thd, const char *db, const char *table_name); bool close_temporary_table(THD *thd, const char *db, const char *table_name); void close_temporary(TABLE *table, bool delete_table); @@ -1274,6 +1274,8 @@ void mysql_lock_abort(THD *thd, TABLE *table); bool mysql_lock_abort_for_thread(THD *thd, TABLE *table); MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b); +TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle, + TABLE_LIST *haystack); bool lock_global_read_lock(THD *thd); void unlock_global_read_lock(THD *thd); bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, --- 1.319/sql/sql_base.cc 2005-12-11 08:30:52 +01:00 +++ 1.320/sql/sql_base.cc 2005-12-27 10:30:49 +01:00 @@ -698,6 +698,7 @@ SYNOPSIS unique_table() + thd thread handle table table which should be checked table_list list of tables @@ -723,7 +724,7 @@ 0 if table is unique */ -TABLE_LIST* unique_table(TABLE_LIST *table, TABLE_LIST *table_list) +TABLE_LIST* unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list) { TABLE_LIST *res; const char *d_name, *t_name; @@ -758,9 +759,10 @@ DBUG_PRINT("info", ("real table: %s.%s", d_name, t_name)); for (;;) { - if (!(res= find_table_in_global_list(table_list, d_name, t_name)) || - (!res->table || res->table != table->table) && - (res->select_lex && !res->select_lex->exclude_from_table_unique_test)) + if (((! (res= find_table_in_global_list(table_list, d_name, t_name))) && + (! (res= mysql_lock_have_duplicate(thd, table, table_list)))) || + ((!res->table || res->table != table->table) && + res->select_lex && !res->select_lex->exclude_from_table_unique_test)) break; /* If we found entry of this table or or table of SELECT which already --- 1.170/sql/sql_delete.cc 2005-12-12 19:11:52 +01:00 +++ 1.171/sql/sql_delete.cc 2005-12-27 10:30:49 +01:00 @@ -348,7 +348,7 @@ } { 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, "DELETE", duplicate); DBUG_RETURN(TRUE); @@ -438,7 +438,7 @@ */ { TABLE_LIST *duplicate; - if ((duplicate= unique_table(target_tbl->correspondent_table, + if ((duplicate= unique_table(thd, target_tbl->correspondent_table, lex->query_tables))) { update_non_unique_table_error(target_tbl->correspondent_table, --- 1.180/sql/sql_insert.cc 2005-12-12 19:11:53 +01:00 +++ 1.181/sql/sql_insert.cc 2005-12-27 10:30:49 +01:00 @@ -873,7 +873,7 @@ { 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); @@ -2174,7 +2174,7 @@ 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; --- 1.518/sql/sql_parse.cc 2005-12-11 08:30:53 +01:00 +++ 1.519/sql/sql_parse.cc 2005-12-27 10:30:49 +01:00 @@ -2835,7 +2835,7 @@ if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) { TABLE_LIST *duplicate; - if ((duplicate= unique_table(create_table, select_tables))) + if ((duplicate= unique_table(thd, create_table, select_tables))) { update_non_unique_table_error(create_table, "CREATE", duplicate); res= 1; @@ -2851,7 +2851,7 @@ tab= tab->next_local) { TABLE_LIST *duplicate; - if ((duplicate= unique_table(tab, select_tables))) + if ((duplicate= unique_table(thd, tab, select_tables))) { update_non_unique_table_error(tab, "CREATE", duplicate); res= 1; --- 1.181/sql/sql_update.cc 2005-12-12 19:11:53 +01:00 +++ 1.182/sql/sql_update.cc 2005-12-27 10:30:50 +01:00 @@ -616,7 +616,7 @@ /* 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 @@ 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 @@ { 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);