You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
944 B
51 lines
944 B
3 months ago
|
#
|
||
|
# Test for bug #55273 "FLUSH TABLE tm WITH READ LOCK for Merge table
|
||
|
# causes assert failure".
|
||
|
#
|
||
|
drop table if exists t1, t2, tm;
|
||
|
create table t1 (i int) engine = myisam;
|
||
|
create table t2 (i int) engine = myisam;
|
||
|
create table tm (i int) engine=merge union=(t1, t2);
|
||
|
insert into t1 values (1), (2);
|
||
|
insert into t2 values (3), (4);
|
||
|
# The below statement should succeed and lock merge
|
||
|
# table for read. Only merge table gets flushed and
|
||
|
# not underlying tables.
|
||
|
flush tables tm with read lock;
|
||
|
select * from tm;
|
||
|
i
|
||
|
1
|
||
|
2
|
||
|
3
|
||
|
4
|
||
|
# Check that underlying tables are locked.
|
||
|
select * from t1;
|
||
|
i
|
||
|
1
|
||
|
2
|
||
|
select * from t2;
|
||
|
i
|
||
|
3
|
||
|
4
|
||
|
unlock tables;
|
||
|
# This statement should succeed as well and flush
|
||
|
# all tables in the list.
|
||
|
flush tables tm, t1, t2 with read lock;
|
||
|
select * from tm;
|
||
|
i
|
||
|
1
|
||
|
2
|
||
|
3
|
||
|
4
|
||
|
# Naturally, underlying tables should be locked in this case too.
|
||
|
select * from t1;
|
||
|
i
|
||
|
1
|
||
|
2
|
||
|
select * from t2;
|
||
|
i
|
||
|
3
|
||
|
4
|
||
|
unlock tables;
|
||
|
drop tables tm, t1, t2;
|