From 4ed1ce6f583751c56c699017e58717e2bf23f53d Mon Sep 17 00:00:00 2001 From: unknown 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. mysql-test/r/temp_table.result: Add result for bug#21096: locking issue ; temporary table conflicts. mysql-test/t/temp_table.test: Add test case for bug#21096: locking issue ; temporary table conflicts. sql/sql_table.cc: Do not use table name locking while executing DROP TEMPORARY TABLE. --- mysql-test/r/temp_table.result | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mysql-test/r/temp_table.result') diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index 0b6bc48c350..80d4e8cc06d 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -108,3 +108,20 @@ d c bar 2 foo 1 drop table t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT); +LOCK TABLE t1 WRITE; +CREATE TEMPORARY TABLE t1 (i INT); +The following command should not block +DROP TEMPORARY TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i INT); +CREATE TEMPORARY TABLE t2 (i INT); +DROP TEMPORARY TABLE t2, t1; +ERROR 42S02: Unknown table 't1' +SELECT * FROM t2; +ERROR 42S02: Table 'test.t2' doesn't exist +SELECT * FROM t1; +i +DROP TABLE t1; +End of 4.1 tests. -- cgit v1.2.1