summaryrefslogtreecommitdiff
path: root/mysql-test/t/temp_table.test
diff options
context:
space:
mode:
authorunknown <dlenev@mockturtle.local>2006-09-29 12:36:12 +0400
committerunknown <dlenev@mockturtle.local>2006-09-29 12:36:12 +0400
commitd4553e35586398a89b005bff0d55280ce237483e (patch)
treed0c779af9a5aa85477ef52d21a56f644886a76ae /mysql-test/t/temp_table.test
parentbe6911d2af9d6a1118aa01e2c798cb8911d15df2 (diff)
parent5d46e2993389f3cffe2a37374ba61334f86f7e5e (diff)
downloadmariadb-git-d4553e35586398a89b005bff0d55280ce237483e.tar.gz
Merge mockturtle.local:/home/dlenev/src/mysql-4.1-bg22338-2
into mockturtle.local:/home/dlenev/src/mysql-5.0-rt-merge mysql-test/r/temp_table.result: Auto merged mysql-test/t/temp_table.test: Auto merged sql/sql_select.cc: Manual merge. sql/sql_table.cc: Manual merge.
Diffstat (limited to 'mysql-test/t/temp_table.test')
-rw-r--r--mysql-test/t/temp_table.test48
1 files changed, 47 insertions, 1 deletions
diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test
index 3920b305b78..8cb9e34ca08 100644
--- a/mysql-test/t/temp_table.test
+++ b/mysql-test/t/temp_table.test
@@ -116,4 +116,50 @@ insert into t2 values (NULL, 'foo'), (NULL, 'bar');
select d, c from t1 left join t2 on b = c where a = 3 order by d;
drop table t1, t2;
-# End of 4.1 tests
+
+#
+# BUG#21096: locking issue ; temporary table conflicts.
+#
+# The problem was that on DROP TEMPORARY table name lock was acquired,
+# which should not be done.
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (i INT);
+
+LOCK TABLE t1 WRITE;
+
+connect (conn1, localhost, root,,);
+
+CREATE TEMPORARY TABLE t1 (i INT);
+
+--echo The following command should not block
+DROP TEMPORARY TABLE t1;
+
+disconnect conn1;
+connection default;
+
+DROP TABLE t1;
+
+#
+# Check that it's not possible to drop a base table with
+# DROP TEMPORARY statement.
+#
+CREATE TABLE t1 (i INT);
+CREATE TEMPORARY TABLE t2 (i INT);
+
+--error 1051
+DROP TEMPORARY TABLE t2, t1;
+
+# Table t2 should have been dropped.
+--error 1146
+SELECT * FROM t2;
+# But table t1 should still be there.
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+
+--echo End of 4.1 tests.