mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / t / tablelock.test
blob5ac93f09ac163d7a43edf76995f4b4fe498afa25
2 # Test of lock tables
5 --disable_warnings
6 drop table if exists t1,t2;
7 --enable_warnings
9 create table t1 ( n int auto_increment primary key);
10 lock tables t1 write;
11 insert into t1 values(NULL);
12 unlock tables;
13 check table t1;
14 lock tables t1 write, t1 as t0 read;
15 insert into t1 values(NULL);
16 unlock tables;
17 check table t1;
18 lock tables t1 write, t1 as t0 read, t1 as t2 read;
19 insert into t1 values(NULL);
20 unlock tables;
21 check table t1;
22 lock tables t1 write, t1 as t0 write, t1 as t2 read;
23 insert into t1 values(NULL);
24 unlock tables;
25 check table t1;
26 lock tables t1 write, t1 as t0 write, t1 as t2 read, t1 as t3 read;
27 insert into t1 values(NULL);
28 unlock tables;
29 check table t1;
30 lock tables t1 write, t1 as t0 write, t1 as t2 write;
31 insert into t1 values(NULL);
32 unlock tables;
33 check table t1;
34 drop table t1;
37 # Test of locking and delete of files
40 CREATE TABLE t1 (a int);
41 CREATE TABLE t2 (a int);
42 lock tables t1 write,t1 as b write, t2 write, t2 as c read;
43 drop table t1,t2;
45 CREATE TABLE t1 (a int);
46 CREATE TABLE t2 (a int);
47 lock tables t1 write,t1 as b write, t2 write, t2 as c read;
48 drop table t2,t1;
49 unlock tables;
51 # End of 4.1 tests
54 # Bug#23588 SHOW COLUMNS on a temporary table causes locking issues
56 create temporary table t1(f1 int);
57 lock tables t1 write;
58 insert into t1 values (1);
59 show columns from t1;
60 insert into t1 values(2);
61 drop table t1;
62 unlock tables;
64 # End of 5.0 tests