Commit 355b74d2 authored by Dmitry Lenev's avatar Dmitry Lenev

Fix for merge.test failures in mysql-5.5-runtime

tree for embedded server

Test case for bug #56251 "Deadlock with INSERT
DELAYED and MERGE tables" can't be run against
embedded server. Embedded server converts all
DELAYED INSERTs into ordinary INSERTs and this
test can't work properly if such conversion
happens.

Moved this test from merge.test to delayed.test
which is skipped if test suite is run with
--embedded-server option.
parent f14d947c
......@@ -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;
......@@ -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
......@@ -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;
......@@ -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
......
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