summaryrefslogtreecommitdiff
path: root/mysql-test/t/lock_multi.test
diff options
context:
space:
mode:
authorunknown <acurtis@xiphis.org>2006-06-12 06:53:31 -0700
committerunknown <acurtis@xiphis.org>2006-06-12 06:53:31 -0700
commit45833dcc1713893a32786a636c85f16726761558 (patch)
tree6e40d89bc67bb0ebd61ce389dde9f195e3e0cf55 /mysql-test/t/lock_multi.test
parent01e8913e7751a04fa7045974147e6fec5f7c150d (diff)
parent25917d6b7efaaf2a15863f3f0d5c1ae292d80bfd (diff)
downloadmariadb-git-45833dcc1713893a32786a636c85f16726761558.tar.gz
Merge acurtis@bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into xiphis.org:/home/antony/work2/p2-bug20168.2 sql/sql_db.cc: Auto merged storage/myisam/mi_check.c: Auto merged storage/myisam/myisamdef.h: Auto merged mysql-test/r/lock_multi.result: manual merge mysql-test/t/lock_multi.test: manual merge
Diffstat (limited to 'mysql-test/t/lock_multi.test')
-rw-r--r--mysql-test/t/lock_multi.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index a24ee8be64e..d0577d6f2f3 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -158,3 +158,36 @@ use test;
connection default;
# End of 5.0 tests
+# Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock
+#
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+#
+connection con1;
+CREATE DATABASE mysqltest_1;
+FLUSH TABLES WITH READ LOCK;
+#
+# With bug in place: acquire LOCK_mysql_create_table and
+# wait in wait_if_global_read_lock().
+connection con2;
+send DROP DATABASE mysqltest_1;
+--sleep 1
+#
+# With bug in place: try to acquire LOCK_mysql_create_table...
+# When fixed: Reject dropping db because of the read lock.
+connection con1;
+--error ER_CANT_UPDATE_WITH_READLOCK
+DROP DATABASE mysqltest_1;
+UNLOCK TABLES;
+#
+connection con2;
+reap;
+#
+connection default;
+disconnect con1;
+disconnect con2;
+# This must have been dropped by connection 2 already,
+# which waited until the global read lock was released.
+--error ER_DB_DROP_EXISTS
+DROP DATABASE mysqltest_1;
+