1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge mysql.com:/home/mydev/mysql-5.0

into  mysql.com:/home/mydev/mysql-5.0-bug5390


BitKeeper/deleted/.del-ha_blackhole.cc~727c69ef7846623a:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
This commit is contained in:
unknown
2005-12-27 10:31:00 +01:00
12 changed files with 219 additions and 41 deletions

View File

@ -698,6 +698,7 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table,
SYNOPSIS
unique_table()
thd thread handle
table table which should be checked
table_list list of tables
@ -723,7 +724,7 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table,
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 @@ TABLE_LIST* unique_table(TABLE_LIST *table, TABLE_LIST *table_list)
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