summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <davi@moksha.com.br>2007-10-10 21:39:22 -0300
committerunknown <davi@moksha.com.br>2007-10-10 21:39:22 -0300
commit27e2f30e05e89a4926f5b03661168d572e7153da (patch)
tree5cc59b725714e24fab250558207fd5992a7a0c6e /mysql-test
parentb24d4a977f2bf0148341ee82e78f06fd3d3bd2b3 (diff)
downloadmariadb-git-27e2f30e05e89a4926f5b03661168d572e7153da.tar.gz
Post-merge test case for Bug 31409
mysql-test/include/handler.inc: Add test case for Bug 31409 mysql-test/r/handler_innodb.result: Add test case result for InnoDB run of the handler test for Bug 31409 mysql-test/r/handler_myisam.result: Add test case result for MyISAM run of the handler test for Bug 31409
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/handler.inc33
-rw-r--r--mysql-test/r/handler_innodb.result18
-rw-r--r--mysql-test/r/handler_myisam.result18
3 files changed, 69 insertions, 0 deletions
diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc
index c957fa81040..71647112126 100644
--- a/mysql-test/include/handler.inc
+++ b/mysql-test/include/handler.inc
@@ -533,3 +533,36 @@ reap;
connection default;
drop table t1,t2;
disconnect flush;
+
+#
+# Bug#31409 RENAME TABLE causes server crash or deadlock when used with HANDLER statements
+#
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+create table t1 (c1 int);
+--echo connection: default
+handler t1 open;
+handler t1 read first;
+connect (flush,localhost,root,,);
+connection flush;
+--echo connection: flush
+--send rename table t1 to t2;
+connection default;
+--echo connection: default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table" and info = "rename table t1 to t2";
+--source include/wait_condition.inc
+handler t2 open;
+handler t2 read first;
+--error ER_NO_SUCH_TABLE
+handler t1 read next;
+handler t1 close;
+handler t2 close;
+connection flush;
+reap;
+connection default;
+drop table t2;
+disconnect flush;
diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result
index 45a6218585d..e9e5c7dbdd5 100644
--- a/mysql-test/r/handler_innodb.result
+++ b/mysql-test/r/handler_innodb.result
@@ -554,6 +554,24 @@ c1
2
handler t1 read next;
c1
+1
handler t1 close;
handler t2 close;
drop table t1,t2;
+drop table if exists t1,t2;
+create table t1 (c1 int);
+connection: default
+handler t1 open;
+handler t1 read first;
+c1
+connection: flush
+rename table t1 to t2;;
+connection: default
+handler t2 open;
+handler t2 read first;
+c1
+handler t1 read next;
+ERROR 42S02: Table 'test.t1' doesn't exist
+handler t1 close;
+handler t2 close;
+drop table t2;
diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result
index bc4a8e9081a..715e5ab03d6 100644
--- a/mysql-test/r/handler_myisam.result
+++ b/mysql-test/r/handler_myisam.result
@@ -554,6 +554,24 @@ c1
2
handler t1 read next;
c1
+1
handler t1 close;
handler t2 close;
drop table t1,t2;
+drop table if exists t1,t2;
+create table t1 (c1 int);
+connection: default
+handler t1 open;
+handler t1 read first;
+c1
+connection: flush
+rename table t1 to t2;;
+connection: default
+handler t2 open;
+handler t2 read first;
+c1
+handler t1 read next;
+ERROR 42S02: Table 'test.t1' doesn't exist
+handler t1 close;
+handler t2 close;
+drop table t2;