summaryrefslogtreecommitdiff
path: root/mysql-test/t/flush.test
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2005-08-08 00:10:07 +0200
committerunknown <ingo@mysql.com>2005-08-08 00:10:07 +0200
commit9de04d2ea94f772180455ff86e24ed68e546fbdf (patch)
treefbe0e29e779081da2f03d69a2b387ea0c9d89424 /mysql-test/t/flush.test
parent84051f2a6d2537b58d63f560b31f8effb0907e99 (diff)
parent25201f23c8ef5a9da5e16c3f29b138043fda687c (diff)
downloadmariadb-git-9de04d2ea94f772180455ff86e24ed68e546fbdf.tar.gz
Merge mysql.com:/home/mydev/mysql-4.1-4100
into mysql.com:/home/mydev/mysql-5.0-5000 mysql-test/r/flush.result: Auto merged mysql-test/t/flush.test: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'mysql-test/t/flush.test')
-rw-r--r--mysql-test/t/flush.test31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index f2bfa45ba59..f5fd9fcadf2 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -70,4 +70,35 @@ insert into t1 values (345);
select * from t1;
drop table t1;
+#
+# Bug#9459 - deadlock with flush with lock, and lock table write
+#
+create table t1 (c1 int);
+lock table t1 write;
+# Cannot get the global read lock with write locked tables.
+--error 1192
+flush tables with read lock;
+lock table t1 read;
+# Can get the global read lock with read locked tables.
+flush tables with read lock;
+--error 1223
+lock table t1 write;
+lock table t1 read;
+--error 1223
+lock table t1 write;
+# Release all table locks and the global read lock.
+unlock tables;
+create table t2 (c1 int);
+create table t3 (c1 int);
+lock table t1 read, t2 read, t3 write;
+# Cannot get the global read lock with write locked tables.
+--error 1192
+flush tables with read lock;
+lock table t1 read, t2 read, t3 read;
+# Can get the global read lock with read locked tables.
+flush tables with read lock;
+# Release all table locks and the global read lock.
+unlock tables;
+drop table t1, t2, t3;
+
# End of 4.1 tests