diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/delayed.result | 28 | ||||
-rw-r--r-- | mysql-test/r/merge.result | 28 | ||||
-rw-r--r-- | mysql-test/t/delayed.test | 49 | ||||
-rw-r--r-- | mysql-test/t/merge.test | 48 |
4 files changed, 77 insertions, 76 deletions
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index 4cb97719ff2..77aa0d49407 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -422,3 +422,31 @@ UNLOCK TABLES; # Connection con1 # Connection default DROP TABLE t1, t2, t3; +# +# Test for bug #56251 "Deadlock with INSERT DELAYED and MERGE tables". +# +drop table if exists t1, t2, tm; +create table t1(a int); +create table t2(a int); +create table tm(a int) engine=merge union=(t1, t2); +begin; +select * from t1; +a +# Connection 'con1'. +# Sending: +alter table t1 comment 'test'; +# Connection 'default'. +# Wait until ALTER TABLE blocks and starts waiting +# for connection 'default'. It should wait with a +# pending SNW lock on 't1'. +# Attempt to perform delayed insert into 'tm' should not lead +# to a deadlock. Instead error ER_DELAYED_NOT_SUPPORTED should +# be emitted. +insert delayed into tm values (1); +ERROR HY000: DELAYED option not supported for table 'tm' +# Unblock ALTER TABLE. +commit; +# Connection 'con1'. +# Reaping ALTER TABLE: +# Connection 'default'. +drop tables tm, t1, t2; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 0481ee8f49a..5d96970ce74 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -3575,32 +3575,4 @@ ERROR HY000: The definition of table 'v1' prevents operation DELETE on table 'm1 drop view v1; drop temporary table tmp; drop table t1, t2, t3, m1, m2; -# -# Test for bug #56251 "Deadlock with INSERT DELAYED and MERGE tables". -# -drop table if exists t1, t2, tm; -create table t1(a int); -create table t2(a int); -create table tm(a int) engine=merge union=(t1, t2); -begin; -select * from t1; -a -# Connection 'con1'. -# Sending: -alter table t1 comment 'test'; -# Connection 'default'. -# Wait until ALTER TABLE blocks and starts waiting -# for connection 'default'. It should wait with a -# pending SNW lock on 't1'. -# Attempt to perform delayed insert into 'tm' should not lead -# to a deadlock. Instead error ER_DELAYED_NOT_SUPPORTED should -# be emitted. -insert delayed into tm values (1); -ERROR HY000: DELAYED option not supported for table 'tm' -# Unblock ALTER TABLE. -commit; -# Connection 'con1'. -# Reaping ALTER TABLE: -# Connection 'default'. -drop tables tm, t1, t2; End of 6.0 tests diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 5f56cdf54e1..3a2bc982ad3 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -552,3 +552,52 @@ disconnect con1; connection default; DROP TABLE t1, t2, t3; --enable_ps_protocol + + +--echo # +--echo # Test for bug #56251 "Deadlock with INSERT DELAYED and MERGE tables". +--echo # +connect (con1,localhost,root,,); +connection default; +--disable_warnings +drop table if exists t1, t2, tm; +--enable_warnings +create table t1(a int); +create table t2(a int); +create table tm(a int) engine=merge union=(t1, t2); +begin; +select * from t1; + +--echo # Connection 'con1'. +connection con1; +--echo # Sending: +--send alter table t1 comment 'test' + +--echo # Connection 'default'. +connection default; +--echo # Wait until ALTER TABLE blocks and starts waiting +--echo # for connection 'default'. It should wait with a +--echo # pending SNW lock on 't1'. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table metadata lock" and + info = "alter table t1 comment 'test'"; +--source include/wait_condition.inc +--echo # Attempt to perform delayed insert into 'tm' should not lead +--echo # to a deadlock. Instead error ER_DELAYED_NOT_SUPPORTED should +--echo # be emitted. +--error ER_DELAYED_NOT_SUPPORTED +insert delayed into tm values (1); +--echo # Unblock ALTER TABLE. +commit; + +--echo # Connection 'con1'. +connection con1; +--echo # Reaping ALTER TABLE: +--reap + +disconnect con1; +--source include/wait_until_disconnected.inc +--echo # Connection 'default'. +connection default; +drop tables tm, t1, t2; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 3633a8b30ad..51c4ca51a29 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -2668,54 +2668,6 @@ drop temporary table tmp; drop table t1, t2, t3, m1, m2; ---echo # ---echo # Test for bug #56251 "Deadlock with INSERT DELAYED and MERGE tables". ---echo # -connect (con1,localhost,root,,); -connection default; ---disable_warnings -drop table if exists t1, t2, tm; ---enable_warnings -create table t1(a int); -create table t2(a int); -create table tm(a int) engine=merge union=(t1, t2); -begin; -select * from t1; - ---echo # Connection 'con1'. -connection con1; ---echo # Sending: ---send alter table t1 comment 'test' - ---echo # Connection 'default'. -connection default; ---echo # Wait until ALTER TABLE blocks and starts waiting ---echo # for connection 'default'. It should wait with a ---echo # pending SNW lock on 't1'. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "alter table t1 comment 'test'"; ---source include/wait_condition.inc ---echo # Attempt to perform delayed insert into 'tm' should not lead ---echo # to a deadlock. Instead error ER_DELAYED_NOT_SUPPORTED should ---echo # be emitted. ---error ER_DELAYED_NOT_SUPPORTED -insert delayed into tm values (1); ---echo # Unblock ALTER TABLE. -commit; - ---echo # Connection 'con1'. -connection con1; ---echo # Reaping ALTER TABLE: ---reap - ---echo # Connection 'default'. -connection default; -disconnect con1; -drop tables tm, t1, t2; - - --echo End of 6.0 tests --disable_result_log |