diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/mdl_sync.result | 16 | ||||
-rw-r--r-- | mysql-test/t/mdl_sync.test | 38 |
2 files changed, 33 insertions, 21 deletions
diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result index ff6daf6443e..984f0df3d0e 100644 --- a/mysql-test/r/mdl_sync.result +++ b/mysql-test/r/mdl_sync.result @@ -1678,14 +1678,21 @@ insert into t2 values (1);; # # Switching to connection 'handler_con1'. # Wait until INSERT is blocked on table-level lock. -# The below statement should not cause deadlock. +# Sending 'alter table t1 drop column j'. It should not cause +# deadlock. alter table t1 drop column j; -unlock tables; +# Switching to connection 'handler_con2'. +# Wait until ALTER is blocked during upgrade. # # Switching to connection 'default'. # Reap INSERT. +ERROR HY000: Wait on a lock was aborted due to a pending exclusive lock handler t1 close; # +# Switching to connection 'handler_con1'. +# Reaping 'alter table t1 drop column j' +unlock tables; +# Switching to connection 'default'. # Then, check the scenario in which upgrade of SNRW lock to X # lock is blocked by HANDLER which is open in connection currently # waiting to get SW lock on the same table. @@ -2248,6 +2255,8 @@ SET DEBUG_SYNC= 'RESET'; # Bug#50786 Assertion `thd->mdl_context.trans_sentinel() == __null' # failed in open_ltable() # +# Supress warnings written to the log file +call mtr.add_suppression("Wait on a lock was aborted due to a pending exclusive lock"); DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (i INT); CREATE TABLE t2 (i INT); @@ -2271,7 +2280,6 @@ SET DEBUG_SYNC= 'now WAIT_FOR parked'; # Sending: SELECT 1; # connection: con3 -# Sending: ALTER TABLE t1 ADD COLUMN j INT; # connection: default SET DEBUG_SYNC= 'now SIGNAL go'; @@ -2284,8 +2292,6 @@ HANDLER t1 CLOSE; # Reaping SELECT 1 1 1 -# connection: con3 -# Reaping ALTER TABLE t1 ADD COLUMN j INT # connection: default DROP TABLE t1, t2; SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/t/mdl_sync.test b/mysql-test/t/mdl_sync.test index b9a9241ce32..ef434e33cfa 100644 --- a/mysql-test/t/mdl_sync.test +++ b/mysql-test/t/mdl_sync.test @@ -2277,17 +2277,32 @@ let $wait_condition= select count(*) = 1 from information_schema.processlist where state = "Table lock" and info = "insert into t2 values (1)"; --source include/wait_condition.inc ---echo # The below statement should not cause deadlock. -alter table t1 drop column j; -unlock tables; +--echo # Sending 'alter table t1 drop column j'. It should not cause +--echo # deadlock. +send alter table t1 drop column j; +--echo # Switching to connection 'handler_con2'. +connection handler_con2; +--echo # Wait until ALTER is blocked during upgrade. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table" and info = "alter table t1 drop column j"; +--source include/wait_condition.inc --echo # --echo # Switching to connection 'default'. connection default; --echo # Reap INSERT. +--error ER_LOCK_ABORTED --reap handler t1 close; - --echo # +--echo # Switching to connection 'handler_con1'. +connection handler_con1; +--echo # Reaping 'alter table t1 drop column j' +--reap +unlock tables; +--echo # Switching to connection 'default'. +connection default; + --echo # Then, check the scenario in which upgrade of SNRW lock to X --echo # lock is blocked by HANDLER which is open in connection currently --echo # waiting to get SW lock on the same table. @@ -3220,6 +3235,8 @@ disconnect con2; --echo # failed in open_ltable() --echo # +--echo # Supress warnings written to the log file +call mtr.add_suppression("Wait on a lock was aborted due to a pending exclusive lock"); --disable_warnings DROP TABLE IF EXISTS t1, t2; --enable_warnings @@ -3279,16 +3296,10 @@ let $wait_condition= # since the latter waits on a table-level lock while having a HANDLER # open. This will cause mysql_lock_tables() in con1 fail which before # triggered the assert. ---echo # Sending: ---send ALTER TABLE t1 ADD COLUMN j INT +ALTER TABLE t1 ADD COLUMN j INT; --echo # connection: default connection default; -let $wait_condition= - SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = "Waiting for table" - AND info = "ALTER TABLE t1 ADD COLUMN j INT"; ---source include/wait_condition.inc SET DEBUG_SYNC= 'now SIGNAL go'; --echo # connection: con1 @@ -3302,11 +3313,6 @@ connection con2; --echo # Reaping SELECT 1 --reap ---echo # connection: con3 -connection con3; ---echo # Reaping ALTER TABLE t1 ADD COLUMN j INT ---reap - --echo # connection: default connection default; DROP TABLE t1, t2; |