2001-10-08 03:58:07 +02:00
|
|
|
# This test doesn't work with the embedded version as this code
|
|
|
|
# assumes that one query is running while we are doing queries on
|
|
|
|
# a second connection.
|
|
|
|
# This would work if mysqltest run would be threaded and handle each
|
|
|
|
# connection in a separate thread.
|
|
|
|
#
|
|
|
|
-- source include/not_embedded.inc
|
|
|
|
|
2001-03-25 00:02:26 +01:00
|
|
|
connect (con1,localhost,root,,);
|
|
|
|
connect (con2,localhost,root,,);
|
2001-03-23 04:04:59 +01:00
|
|
|
connection con1;
|
|
|
|
drop table if exists t1;
|
2001-03-24 03:59:30 +01:00
|
|
|
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;
|
2001-09-28 07:05:54 +02:00
|
|
|
disable_query_log;
|
2001-03-24 03:59:30 +01:00
|
|
|
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;
|
|
|
|
}
|
2001-09-28 07:05:54 +02:00
|
|
|
enable_query_log;
|
2001-03-23 04:04:59 +01:00
|
|
|
connection con1;
|
|
|
|
select * from t1;
|
2001-03-27 06:03:08 +02:00
|
|
|
connection con2;
|
|
|
|
flush tables with read lock;
|
|
|
|
--error 1099;
|
2001-03-24 03:59:30 +01:00
|
|
|
drop table t2;
|
2001-03-27 06:03:08 +02:00
|
|
|
connection con1;
|
|
|
|
send drop table t2;
|
|
|
|
connection con2;
|
|
|
|
unlock tables;
|
|
|
|
connection con1;
|
|
|
|
reap;
|
2001-06-02 01:43:32 +02:00
|
|
|
|
2001-06-21 23:59:51 +02:00
|
|
|
#test if drop database will wait until we release the global read lock
|
|
|
|
connection con1;
|
2001-12-22 14:13:31 +01:00
|
|
|
drop database if exists mysqltest;
|
|
|
|
create database mysqltest;
|
|
|
|
create table mysqltest.t1(n int);
|
|
|
|
insert into mysqltest.t1 values (23);
|
2001-06-21 23:59:51 +02:00
|
|
|
flush tables with read lock;
|
|
|
|
connection con2;
|
2001-12-22 14:13:31 +01:00
|
|
|
send drop database mysqltest;
|
2001-06-21 23:59:51 +02:00
|
|
|
connection con1;
|
2001-12-22 14:13:31 +01:00
|
|
|
select * from mysqltest.t1;
|
2001-06-21 23:59:51 +02:00
|
|
|
unlock tables;
|
|
|
|
connection con2;
|
|
|
|
reap;
|
|
|
|
|
2001-06-02 01:43:32 +02:00
|
|
|
# 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;
|
2001-12-06 00:05:30 +01:00
|
|
|
|