~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
drop table if exists t1,t2;
2
create table t1(n int);
3
insert into t1 values (1);
4
lock tables t1 write;
5
update low_priority t1 set n = 4;
6
select n from t1;
7
unlock tables;
8
n
9
4
10
drop table t1;
11
create table t1(n int);
12
insert into t1 values (1);
13
lock tables t1 read;
14
update low_priority t1 set n = 4;
15
select n from t1;
16
n
17
1
18
unlock tables;
19
drop table t1;
20
create table t1 (a int, b int);
21
create table t2 (c int, d int);
22
insert into t1 values(1,1);
23
insert into t1 values(2,2);
24
insert into t2 values(1,2);
25
lock table t1 read;
26
update t1,t2 set c=a where b=d;
27
select c from t2;
28
c
29
2
30
unlock tables;
31
drop table t1;
32
drop table t2;
33
create table t1 (a int);
34
create table t2 (a int);
35
lock table t1 write, t2 write;
36
insert t1 select * from t2;
37
drop table t2;
38
ERROR 42S02: Table 'test.t2' doesn't exist
39
drop table t1;
40
create table t1 (a int);
41
create table t2 (a int);
42
lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
43
insert t1 select * from t2;
44
drop table t2;
45
ERROR 42S02: Table 'test.t2' doesn't exist
46
drop table t1;
47
End of 4.1 tests
48
create table t1(a int);
49
lock tables t1 write;
50
show columns from t1;
51
Field	Type	Null	Key	Default	Extra
52
a	int(11)	YES		NULL	
53
unlock tables;
54
drop table t1;
55
use mysql;
56
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
57
FLUSH TABLES;
58
use mysql;
59
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
60
OPTIMIZE TABLES columns_priv, db, host, user;
61
Table	Op	Msg_type	Msg_text
62
mysql.columns_priv	optimize	status	OK
63
mysql.db	optimize	status	OK
64
mysql.host	optimize	status	OK
65
mysql.user	optimize	status	OK
66
UNLOCK TABLES;
67
Select_priv
68
N
69
use test;
70
use test;
71
CREATE TABLE t1 (c1 int);
72
LOCK TABLE t1 WRITE;
73
FLUSH TABLES WITH READ LOCK;
74
CREATE TABLE t2 (c1 int);
75
UNLOCK TABLES;
76
UNLOCK TABLES;
77
DROP TABLE t1, t2;
78
CREATE TABLE t1 (c1 int);
79
LOCK TABLE t1 WRITE;
80
FLUSH TABLES WITH READ LOCK;
81
CREATE TABLE t2 AS SELECT * FROM t1;
82
ERROR HY000: Table 't2' was not locked with LOCK TABLES
83
UNLOCK TABLES;
84
UNLOCK TABLES;
85
DROP TABLE t1;
86
CREATE DATABASE mysqltest_1;
87
FLUSH TABLES WITH READ LOCK;
88
DROP DATABASE mysqltest_1;
89
DROP DATABASE mysqltest_1;
90
ERROR HY000: Can't execute the query because you have a conflicting read lock
91
UNLOCK TABLES;
92
DROP DATABASE mysqltest_1;
93
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
94
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
95
lock tables t1 write;
96
alter table t1 auto_increment=0;
97
alter table t1 auto_increment=0;
98
unlock tables;
99
drop table t1;
100
End of 5.0 tests
101
create table t1 (i int);
102
lock table t1 read;
103
update t1 set i= 10;;
104
select * from t1;;
105
kill query ID;
106
i
107
ERROR 70100: Query execution was interrupted
108
unlock tables;
109
drop table t1;
110
drop table if exists t1;
111
create table t1 (a int) ENGINE=MEMORY;
112
--> client 2
113
handler t1 open;
114
ERROR HY000: Table storage engine for 't1' doesn't have this option
115
--> client 1
116
drop table t1;
117
drop table if exists t1;
118
create table t1 (i int);
119
connection: default
120
lock tables t1 write;
121
connection: flush
122
flush tables with read lock;;
123
connection: default
124
alter table t1 add column j int;
125
connection: insert
126
insert into t1 values (1,2);;
127
connection: default
128
unlock tables;
129
connection: flush
130
select * from t1;
131
i	j
132
unlock tables;
133
select * from t1;
134
i	j
135
1	2
136
drop table t1;
137
drop table if exists t1;
138
create table t1 (i int);
139
connection: default
140
lock tables t1 write;
141
connection: flush
142
flush tables with read lock;;
143
connection: default
144
flush tables;
145
unlock tables;
146
drop table t1;
147
drop table if exists t1,t2;
148
create table t1 (a int);
149
flush status;
150
lock tables t1 read;
151
insert into t1 values(1);
152
unlock tables;
153
drop table t1;
154
select @tlwa < @tlwb;
155
@tlwa < @tlwb
156
1
157
End of 5.1 tests
158
drop table if exists t1;
159
create table t1 (i int);
160
connection: default
161
lock tables t1 write;
162
connection: flush
163
flush tables with read lock;;
164
connection: default
165
flush tables;
166
drop table t1;