summaryrefslogtreecommitdiff
path: root/mysql-test/t/lock.test
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@sun.com>2009-12-08 14:14:05 +0100
committerJon Olav Hauglid <jon.hauglid@sun.com>2009-12-08 14:14:05 +0100
commita164203fea122604d4167886102e61fbff6ccd1f (patch)
treed7fadbb5bebb95099083e937e9bf883c071032c2 /mysql-test/t/lock.test
parentce5c87a3d359d528111d84b5c75bdb8acfe3fb9c (diff)
downloadmariadb-git-a164203fea122604d4167886102e61fbff6ccd1f.tar.gz
Backport of revno: 2617.56.21
Bug #45066 FLUSH TABLES WITH READ LOCK deadlocks against LOCK TABLE Test coverage for combinations of LOCK TABLE READ / WRITE and FLUSH TABLES / FLUSH TABLES WITH READ LOCK added to lock.test. LOCK and FLUSH are executed sequentially from one connection.
Diffstat (limited to 'mysql-test/t/lock.test')
-rw-r--r--mysql-test/t/lock.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test
index eaba2693904..4d610559077 100644
--- a/mysql-test/t/lock.test
+++ b/mysql-test/t/lock.test
@@ -386,5 +386,37 @@ unlock tables;
drop table t1;
--echo #
+--echo # Bug#45066 FLUSH TABLES WITH READ LOCK deadlocks against
+--echo # LOCK TABLE
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(a INT);
+
+LOCK TABLE t1 READ;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH TABLES;
+
+LOCK TABLE t1 WRITE;
+FLUSH TABLES;
+
+--echo #
+--echo # If you allow the next combination, you reintroduce bug Bug#45066
+--echo #
+LOCK TABLE t1 READ;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
+FLUSH TABLES WITH READ LOCK;
+
+LOCK TABLE t1 WRITE;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
+FLUSH TABLES WITH READ LOCK;
+
+UNLOCK TABLES;
+DROP TABLE t1;
+
+--echo #
--echo # End of 6.0 tests.
--echo #