summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/flush.result17
-rw-r--r--mysql-test/r/lock_multi.result11
-rw-r--r--mysql-test/t/flush.test31
-rw-r--r--mysql-test/t/lock_multi.test32
4 files changed, 91 insertions, 0 deletions
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index 7eb7fd16edb..ce64e09c1d3 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -55,3 +55,20 @@ 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;
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index af49e1a27dc..079f92ca420 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -88,3 +88,14 @@ alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1
alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; alter table t1 auto_increment=0; //
unlock tables;
drop table t1;
+drop table if exists t1;
+create table t1 (a int);
+connection: locker
+lock tables t1 read;
+connection: writer
+create table t2 like t1;;
+connection: default
+kill query
+ERROR 70100: Query execution was interrupted
+unlock tables;
+drop table t1;
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index 3a4f2f2f5f2..72efa8a2ee6 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -133,4 +133,35 @@ disconnect con3;
connection default;
drop table t1, t2;
+#
+# Bug#32528 Global read lock with a low priority write lock causes a server crash
+#
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+set session low_priority_updates=1;
+
+create table t1 (a int);
+create table t2 (b int);
+
+lock tables t1 write;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
+flush tables with read lock;
+unlock tables;
+
+lock tables t1 read, t2 write;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
+flush tables with read lock;
+unlock tables;
+
+lock tables t1 read;
+flush tables with read lock;
+unlock tables;
+
+drop table t1, t2;
+
+set session low_priority_updates=default;
+
# End of 5.0 tests
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index d670bb55a18..649c1a4efbd 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -249,4 +249,36 @@ reap;
connection locker;
drop table t1;
+#
+# Bug#31479 Bad lock interaction if CREATE TABLE LIKE is killed
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+--echo connection: locker
+connection locker;
+lock tables t1 read;
+--echo connection: writer
+connection writer;
+let $ID= `select connection_id()`;
+--send create table t2 like t1;
+--echo connection: default
+connection default;
+let $show_type= open tables where in_use=2 and name_locked=1;
+let $show_pattern= '%t1%2%1';
+--source include/wait_show_pattern.inc
+--echo kill query
+disable_query_log;
+eval kill query $ID;
+enable_query_log;
+connection writer;
+--error ER_QUERY_INTERRUPTED
+--reap
+connection locker;
+unlock tables;
+connection default;
+drop table t1;
+
# End of 5.0 tests