From 2a4221489bdb97123ae981488ee3de5f18e19604 Mon Sep 17 00:00:00 2001 From: "kroki/tomash@moonlight.intranet" <> Date: Tue, 29 Aug 2006 16:59:20 +0400 Subject: BUG#21096: locking issue ; temporary table conflicts. The problem was that during DROP TEMPORARY TABLE we tried to acquire the name lock, though temporary tables belongs to one connection, and no race is possible. The solution is to not use table name locking while executing DROP TEMPORARY TABLE. --- sql/sql_table.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 631d2d89bbb..5fc4bb6d79f 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -214,7 +214,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, bool some_tables_deleted=0, tmp_table_deleted=0, foreign_key_error=0; DBUG_ENTER("mysql_rm_table_part2"); - if (lock_table_names(thd, tables)) + if (!drop_temporary && lock_table_names(thd, tables)) DBUG_RETURN(1); for (table=tables ; table ; table=table->next) @@ -311,7 +311,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, } } - unlock_table_names(thd, tables); + if (!drop_temporary) + unlock_table_names(thd, tables); DBUG_RETURN(error); } -- cgit v1.2.1