flush.test 840 Bytes
Newer Older
unknown's avatar
unknown committed
1 2
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
3 4
connection con1;
drop table if exists t1;
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
create temporary table t1(n int not null primary key);
drop table if exists t2;
create table t2(n int);
insert into t2 values(3);
let $1=100;
while ($1)
{
 connection con1;
 send replace into t1 select n from t2;
 connection con2;
 send flush tables;
 connection con1;
 reap;
 connection con2;
 reap;
 dec $1;
}

23 24
connection con1;
select * from t1;
25 26 27
connection con2;
flush tables with read lock;
--error 1099;
28
drop table t2;
29 30 31 32 33 34
connection con1;
send drop table t2;
connection con2;
unlock tables;
connection con1;
reap;
35 36 37 38 39 40 41 42 43 44

# test if dirty close releases global read lock
connection con1;
create table t1 (n int);
flush tables with read lock;
dirty_close con1;
connection con2;
insert into t1 values (345);
select * from t1;
drop table t1;