~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/flush.test

  • Committer: Daniel Nichter
  • Date: 2011-10-23 16:01:37 UTC
  • mto: This revision was merged to the branch mainline in revision 2448.
  • Revision ID: daniel@percona.com-20111023160137-7ac3blgz8z4tf8za
Add Administration Getting Started and Logging.  Capitalize SQL clause keywords.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
select * from t1;
30
30
connection con2;
31
31
flush tables with read lock;
32
 
--error 1223
 
32
--error ER_CANT_UPDATE_WITH_READLOCK
33
33
drop table t2;
34
34
connection con1;
35
35
send drop table t2;
52
52
connection con2;
53
53
reap;
54
54
 
55
 
# test if dirty close releases global read lock
56
 
connection con1;
57
 
create table t1 (n int);
58
 
flush tables with read lock;
59
 
dirty_close con1;
60
 
connection con2;
61
 
insert into t1 values (345);
62
 
select * from t1;
63
 
drop table t1;
64
 
 
65
 
#
66
 
# Bug#9459 - deadlock with flush with lock, and lock table write
67
 
#
68
 
create table t1 (c1 int);
69
 
lock table t1 write;
70
 
# Cannot get the global read lock with write locked tables.
71
 
--error 1192
72
 
flush tables with read lock;
73
 
lock table t1 read;
74
 
# Can get the global read lock with read locked tables.
75
 
flush tables with read lock;
76
 
--error 1223
77
 
lock table t1 write;
78
 
lock table t1 read;
79
 
--error 1223
80
 
lock table t1 write;
81
 
# Release all table locks and the global read lock.
82
 
unlock tables;
83
 
create table t2 (c1 int);
84
 
create table t3 (c1 int);
85
 
lock table t1 read, t2 read, t3 write;
86
 
# Cannot get the global read lock with write locked tables.
87
 
--error 1192
88
 
flush tables with read lock;
89
 
lock table t1 read, t2 read, t3 read;
90
 
# Can get the global read lock with read locked tables.
91
 
flush tables with read lock;
92
 
# Release all table locks and the global read lock.
93
 
unlock tables;
94
 
drop table t1, t2, t3;
 
55
## test if dirty close releases global read lock
 
56
#connection con1;
 
57
#create table t1 (n int);
 
58
#flush tables with read lock;
 
59
#dirty_close con1;
 
60
#connection con2;
 
61
#insert into t1 values (345);
 
62
#select * from t1;
 
63
#drop table t1;
95
64
 
96
65
# End of 4.1 tests
97
66
 
103
72
create table t1 (c1 int);
104
73
create table t2 (c1 int);
105
74
 
106
 
connect (con1,localhost,root,,);
107
75
connect (con3,localhost,root,,);
108
76
 
109
77
connection con1;
110
 
lock table t1 write;
111
78
 
112
79
connection con2;
113
80
send flush tables with read lock;
114
 
--sleep 1
115
81
 
116
82
connection con3;
117
83
send insert into t2 values(1);
118
 
--sleep 1
119
84
 
120
85
connection con1;
 
86
--error ER_NO_LOCK_HELD
121
87
unlock tables;
122
88
disconnect con1;
123
89
 
134
100
drop table t1, t2;
135
101
 
136
102
#
137
 
# Bug#32528 Global read lock with a low priority write lock causes a server crash
138
 
#
139
 
 
140
 
--disable_warnings
141
 
drop table if exists t1, t2;
142
 
--enable_warnings
143
 
 
144
 
set session low_priority_updates=1;
145
 
 
146
 
create table t1 (a int);
147
 
create table t2 (b int);
148
 
 
149
 
lock tables t1 write;
150
 
--error ER_LOCK_OR_ACTIVE_TRANSACTION
151
 
flush tables with read lock;
152
 
unlock tables;
153
 
 
154
 
lock tables t1 read, t2 write;
155
 
--error ER_LOCK_OR_ACTIVE_TRANSACTION
156
 
flush tables with read lock;
157
 
unlock tables;
158
 
 
159
 
lock tables t1 read;
160
 
flush tables with read lock;
161
 
unlock tables;
162
 
 
163
 
drop table t1, t2;
164
 
 
165
 
set session low_priority_updates=default;
166
 
 
167
 
#
168
103
# Bug #33334 mysqltest_embedded crashes when disconnecting before reap
169
104
#
170
105
 
175
110
 
176
111
--echo End of 5.0 tests
177
112
 
178
 
#
179
 
# Bug #26380: LOCK TABLES + FLUSH LOGS causes deadlock
180
 
#
181
 
set @old_general_log= @@general_log;
182
 
set @old_read_only= @@read_only;
183
 
set global general_log= on;
184
 
 
185
 
flush tables with read lock;
186
 
flush logs;
187
 
unlock tables;
188
 
 
189
 
set global read_only=1;
190
 
flush logs;
191
 
unlock tables;
192
 
 
193
 
flush tables with read lock;
194
 
flush logs;
195
 
unlock tables;
196
 
 
197
 
set global general_log= @old_general_log;
198
 
set global read_only= @old_read_only;
199
 
 
200
 
--echo End of 5.1 tests