1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
drop table if exists t1,t2;
drop database if exists mysqltest;
create temporary table t1(n int not null primary key);
create table t2(n int);
insert into t2 values(3);
select * from t1;
n
3
flush tables with read lock;
drop table t2;
ERROR HY000: Can't execute the query because you have a conflicting read lock
drop table t2;
unlock tables;
create database mysqltest;
create table mysqltest.t1(n int);
insert into mysqltest.t1 values (23);
flush tables with read lock;
drop database mysqltest;
select * from mysqltest.t1;
n
23
unlock tables;
create table t1 (n int);
flush tables with read lock;
insert into t1 values (345);
select * from t1;
n
345
drop table t1;
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;
create table t1 (c1 int);
create table t2 (c1 int);
lock table t1 write;
flush tables with read lock;
insert into t2 values(1);
unlock tables;
drop table t1, t2;
drop table if exists t1, t2;
set session low_priority_updates=1;
create table t1 (a int);
create table t2 (b int);
lock tables 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
unlock tables;
lock tables t1 read, t2 write;
flush tables with read lock;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
lock tables t1 read;
flush tables with read lock;
unlock tables;
drop table t1, t2;
set session low_priority_updates=default;
select benchmark(200, (select sin(1))) > 1000;
End of 5.0 tests
set @old_general_log= @@general_log;
set @old_read_only= @@read_only;
set global general_log= on;
flush tables with read lock;
flush logs;
unlock tables;
set global read_only=1;
flush logs;
unlock tables;
flush tables with read lock;
flush logs;
unlock tables;
set global general_log= @old_general_log;
set global read_only= @old_read_only;
End of 5.1 tests
|