summaryrefslogtreecommitdiff
path: root/mysql-test/t/lock_multi.test
diff options
context:
space:
mode:
authorunknown <dlenev@mockturtle.local>2007-08-05 13:55:37 +0400
committerunknown <dlenev@mockturtle.local>2007-08-05 13:55:37 +0400
commit8860704088c0269b2e2c2ec95db3b480e2a6216c (patch)
tree8772387e248882a2040e57be50ecc023052dae9b /mysql-test/t/lock_multi.test
parent5b25fc54055c5a609f92018997903643d95cf967 (diff)
downloadmariadb-git-8860704088c0269b2e2c2ec95db3b480e2a6216c.tar.gz
Added test for bug #21281 "Pending write lock is incorrectly removed
when its statement being KILLed". The bug itself was fixed by separate patch in 5.0 tree. mysql-test/r/lock_multi.result: Added test for bug #21281 "Pending write lock is incorrectly removed when its statement being KILLed". mysql-test/t/lock_multi.test: Added test for bug #21281 "Pending write lock is incorrectly removed when its statement being KILLed".
Diffstat (limited to 'mysql-test/t/lock_multi.test')
-rw-r--r--mysql-test/t/lock_multi.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 4a6b4ff5e56..b7c406f9637 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -270,3 +270,38 @@ drop table t1;
# End of 5.0 tests
+
+#
+# Bug #21281 "Pending write lock is incorrectly removed when its
+# statement being KILLed"
+#
+create table t1 (i int);
+connection locker;
+lock table t1 read;
+connection writer;
+--send update t1 set i= 10;
+connection reader;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "update t1 set i= 10";
+--source include/wait_condition.inc
+--send select * from t1;
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and info = "select * from t1";
+--source include/wait_condition.inc
+let $ID= `select id from information_schema.processlist where state = "Locked" and info = "update t1 set i= 10"`;
+--replace_result $ID ID
+eval kill query $ID;
+connection reader;
+--reap
+connection writer;
+--error ER_QUERY_INTERRUPTED
+--reap
+connection locker;
+unlock tables;
+connection default;
+drop table t1;
+
+--echo End of 5.1 tests