diff options
author | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-01-15 12:47:22 +0100 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-01-15 12:47:22 +0100 |
commit | 2a340691ff3839a37094f139a5c419b7d4007cb8 (patch) | |
tree | f3e9005e0768dfa3e5bf05c1a6ea0c4390051cb1 /mysql-test/t/lock.test | |
parent | ad6adb1398e08ffa92dd9bce26b04cdf747ff312 (diff) | |
download | mariadb-git-2a340691ff3839a37094f139a5c419b7d4007cb8.tar.gz |
Bug #43685 Lock table affects other non-related tables
The problem was that FLUSH TABLE <table_list> would block,
waiting for all tables with old versions to be removed from
the table definition cache, rather than waiting for only
the tables in <table_list>. This could happen if FLUSH TABLE
was used in combination with LOCK TABLES.
With the new MDL code, this problem is no longer repeatable.
Regression test case added to lock.test. This commit contains
no code changes.
Diffstat (limited to 'mysql-test/t/lock.test')
-rw-r--r-- | mysql-test/t/lock.test | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test index 49e98abdc76..bc9d1ea8245 100644 --- a/mysql-test/t/lock.test +++ b/mysql-test/t/lock.test @@ -2,6 +2,9 @@ # Testing of table locking # +# Save the initial number of concurrent sessions. +--source include/count_sessions.inc + --disable_warnings drop table if exists t1,t2,t3; --enable_warnings @@ -464,5 +467,42 @@ DROP TABLE t1; --echo # +--echo # Bug#43685 Lock table affects other non-related tables +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +connect (con2, localhost, root); +CREATE TABLE t1 (id INT); +CREATE TABLE t2 (id INT); + +--echo # Connection default +connection default; +LOCK TABLE t1 WRITE; +ANALYZE TABLE t1; + +--echo # Connection con2 +connection con2; +LOCK TABLE t2 WRITE; +--echo # This used to hang until the first connection +--echo # unlocked t1. +FLUSH TABLE t2; + +UNLOCK TABLES; + +--echo # Connection default +connection default; +UNLOCK TABLES; +DROP TABLE t1, t2; +disconnect con2; + + +--echo # --echo # End of 6.0 tests. --echo # + +# Check that all connections opened by test cases in this file are really +# gone so execution of other tests won't be affected by their presence. +--source include/wait_until_count_sessions.inc |