summaryrefslogtreecommitdiff
path: root/mysql-test/t/mdl_sync.test
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-03-13 13:58:27 +0300
committerKonstantin Osipov <kostja@sun.com>2010-03-13 13:58:27 +0300
commit7116431a8a089e2f32d756073968951760d629cf (patch)
tree6b9c6dacc901f2c4ee1b09bfa596846e1c345e4c /mysql-test/t/mdl_sync.test
parentea70b6a20a7fe27bdfe5ed0a828cdddf72b8a5d2 (diff)
downloadmariadb-git-7116431a8a089e2f32d756073968951760d629cf.tar.gz
A review comment for the fix for Bug#46672.
Remove unnecessary need_reopen loops.
Diffstat (limited to 'mysql-test/t/mdl_sync.test')
-rw-r--r--mysql-test/t/mdl_sync.test38
1 files changed, 22 insertions, 16 deletions
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;