Commit 3e7519f1 authored by Sergei Golubchik's avatar Sergei Golubchik

fix mdl_sync test to work now when ALTER TABLE .. ENGINE=xxx may be executed online

parent c8ee83ee
......@@ -3086,18 +3086,17 @@ DELETE FROM t2 WHERE a = 3;
# Now that DELETE blocks on a metadata lock, we should be able to do
# SELECT * FROM m1 here. SELECT used to be blocked by a DELETE table
# lock request.
SELECT * FROM m1;
a
1
2
3
4
SELECT * FROM m1 WHERE a < 3;
# Resuming ALTER TABLE
SET DEBUG_SYNC= 'now SIGNAL continue';
# Connection con1
# Reaping: ALTER TABLE m1 engine=MERGE UNION=(t2, t1)
# Connection con2
# Reaping: DELETE FROM t2 WHERE a = 3
# Reaping: SELECT * FROM m1 WHERE a < 3
a
1
2
# Connection default
DROP TABLE m1, t1, t2;
SET DEBUG_SYNC= 'RESET';
......@@ -4750,6 +4750,7 @@ INSERT INTO t2 VALUES (3), (4);
connect(con1, localhost, root);
connect(con2, localhost, root);
connect(con3, localhost, root);
--echo # Connection con1
connection con1;
......@@ -4769,7 +4770,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR upgrade';
--send DELETE FROM t2 WHERE a = 3
--echo # Connection default
connection default;
connection con3;
--echo # Check that DELETE is waiting on a metadata lock and not a table lock.
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
......@@ -4779,7 +4780,9 @@ let $wait_condition=
--echo # Now that DELETE blocks on a metadata lock, we should be able to do
--echo # SELECT * FROM m1 here. SELECT used to be blocked by a DELETE table
--echo # lock request.
SELECT * FROM m1;
--send SELECT * FROM m1 WHERE a < 3
connection default;
--echo # Resuming ALTER TABLE
SET DEBUG_SYNC= 'now SIGNAL continue';
......@@ -4791,12 +4794,16 @@ connection con1;
connection con2;
--echo # Reaping: DELETE FROM t2 WHERE a = 3
--reap
connection con3;
--echo # Reaping: SELECT * FROM m1 WHERE a < 3
--reap
--echo # Connection default
connection default;
DROP TABLE m1, t1, t2;
SET DEBUG_SYNC= 'RESET';
disconnect con1;
disconnect con2;
disconnect con3;
# Check that all connections opened by test cases in this file are really
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment