2003-01-06 00:48:59 +01:00
|
|
|
drop table if exists t1,t2;
|
|
|
|
drop database if exists mysqltest;
|
2001-09-28 07:05:54 +02:00
|
|
|
create temporary table t1(n int not null primary key);
|
|
|
|
create table t2(n int);
|
|
|
|
insert into t2 values(3);
|
|
|
|
select * from t1;
|
2001-03-23 04:04:59 +01:00
|
|
|
n
|
|
|
|
3
|
2001-09-28 07:05:54 +02:00
|
|
|
flush tables with read lock;
|
|
|
|
drop table t2;
|
2005-03-16 08:40:19 +01:00
|
|
|
ERROR HY000: Can't execute the query because you have a conflicting read lock
|
2001-09-28 07:05:54 +02:00
|
|
|
drop table t2;
|
|
|
|
unlock tables;
|
2001-12-22 14:13:31 +01:00
|
|
|
create database mysqltest;
|
|
|
|
create table mysqltest.t1(n int);
|
|
|
|
insert into mysqltest.t1 values (23);
|
2001-09-28 07:05:54 +02:00
|
|
|
flush tables with read lock;
|
2001-12-22 14:13:31 +01:00
|
|
|
drop database mysqltest;
|
|
|
|
select * from mysqltest.t1;
|
2001-06-02 01:43:32 +02:00
|
|
|
n
|
2001-06-21 23:59:51 +02:00
|
|
|
23
|
2001-09-28 07:05:54 +02:00
|
|
|
unlock tables;
|
|
|
|
create table t1 (n int);
|
|
|
|
flush tables with read lock;
|
|
|
|
insert into t1 values (345);
|
|
|
|
select * from t1;
|
2001-06-21 23:59:51 +02:00
|
|
|
n
|
2001-06-02 01:43:32 +02:00
|
|
|
345
|
2001-09-28 07:05:54 +02:00
|
|
|
drop table t1;
|
2005-08-05 15:37:24 +02:00
|
|
|
create table t1 (c1 int);
|
|
|
|
lock table t1 write;
|
|
|
|
flush tables with read lock;
|
|
|
|
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
|
|
|
lock table t1 read;
|
|
|
|
flush tables with read lock;
|
|
|
|
lock table t1 write;
|
|
|
|
ERROR HY000: Can't execute the query because you have a conflicting read lock
|
|
|
|
lock table t1 read;
|
|
|
|
lock table t1 write;
|
|
|
|
ERROR HY000: Can't execute the query because you have a conflicting read lock
|
|
|
|
unlock tables;
|
|
|
|
create table t2 (c1 int);
|
|
|
|
create table t3 (c1 int);
|
|
|
|
lock table t1 read, t2 read, t3 write;
|
|
|
|
flush tables with read lock;
|
|
|
|
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
|
|
|
lock table t1 read, t2 read, t3 read;
|
|
|
|
flush tables with read lock;
|
|
|
|
unlock tables;
|
|
|
|
drop table t1, t2, t3;
|