Commit 1e76c806 authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com
Browse files

fixed drop/create database bug when holding global read lock

preserve originating server id in Intvar events to avoid inifinite loops
parent 11e56722
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -208,4 +208,6 @@
#define ER_LOCK_WAIT_TIMEOUT 1205
#define ER_LOCK_TABLE_FULL 1206
#define ER_READ_ONLY_TRANSACTION 1207
#define ER_ERROR_MESSAGES 208
#define ER_DROP_DB_WITH_READ_LOCK 1208
#define ER_CREATE_DB_WITH_READ_LOCK 1209
#define ER_ERROR_MESSAGES 210
+7 −0
Original line number Diff line number Diff line
n
1
Database
foo
mysql
test
Database
mysql
test
+2 −0
Original line number Diff line number Diff line
n
3
n
23
n
345
+13 −0
Original line number Diff line number Diff line
@@ -10,3 +10,16 @@ insert into t1 values(2);
create table t1(n int);
drop table t1;
select * from t1;
drop database if exists foo;
flush tables with read lock;
--error 1209
create database foo;
unlock tables;
create database foo;
show databases;
flush tables with read lock;
--error 1208
drop database foo;
unlock tables;
drop database foo;
show databases;
+15 −0
Original line number Diff line number Diff line
@@ -33,6 +33,21 @@ unlock tables;
connection con1;
reap;

#test if drop database will wait until we release the global read lock
connection con1;
drop database if exists foo;
create database foo;
create table foo.t1(n int);
insert into foo.t1 values (23);
flush tables with read lock;
connection con2;
send drop database foo;
connection con1;
select * from foo.t1;
unlock tables;
connection con2;
reap;

# test if dirty close releases global read lock
connection con1;
create table t1 (n int);
Loading