summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2006-06-26 19:43:28 +0200
committerunknown <ingo@mysql.com>2006-06-26 19:43:28 +0200
commit8fe3c29f84a49d6338a63e53d0ab6c46d8d181a3 (patch)
tree3f0cf8c754824d2c2dd7cb52d7d04e7865245b7a /mysql-test/t
parent90ff8fbd380154b6b1efef259d326185277f007a (diff)
parent70c7e30d16bb4599d945a92dd7ca7a8da7c1cec8 (diff)
downloadmariadb-git-8fe3c29f84a49d6338a63e53d0ab6c46d8d181a3.tar.gz
Merge istruewing@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/mydev/mysql-5.0-bug16986-main sql/sql_table.cc: Auto merged
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/lock_multi.test50
1 files changed, 50 insertions, 0 deletions
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 905d0699e6a..627c33b3d82 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -142,6 +142,7 @@ disconnect con2;
--error ER_DB_DROP_EXISTS
DROP DATABASE mysqltest_1;
+#
# Bug#16986 - Deadlock condition with MyISAM tables
#
connection locker;
@@ -170,6 +171,55 @@ connection locker;
use test;
#
connection default;
+#
+# Test if CREATE TABLE with LOCK TABLE deadlocks.
+#
+connection writer;
+CREATE TABLE t1 (c1 int);
+LOCK TABLE t1 WRITE;
+#
+# This waits until t1 is unlocked.
+connection locker;
+send FLUSH TABLES WITH READ LOCK;
+--sleep 1
+#
+# This must not block.
+connection writer;
+CREATE TABLE t2 (c1 int);
+UNLOCK TABLES;
+#
+# This awakes now.
+connection locker;
+reap;
+UNLOCK TABLES;
+#
+connection default;
+DROP TABLE t1, t2;
+#
+# Test if CREATE TABLE SELECT with LOCK TABLE deadlocks.
+#
+connection writer;
+CREATE TABLE t1 (c1 int);
+LOCK TABLE t1 WRITE;
+#
+# This waits until t1 is unlocked.
+connection locker;
+send FLUSH TABLES WITH READ LOCK;
+--sleep 1
+#
+# This must not block.
+connection writer;
+--error 1100
+CREATE TABLE t2 AS SELECT * FROM t1;
+UNLOCK TABLES;
+#
+# This awakes now.
+connection locker;
+reap;
+UNLOCK TABLES;
+#
+connection default;
+DROP TABLE t1;
#
# Bug #17264: MySQL Server freeze