summaryrefslogtreecommitdiff
path: root/mysql-test/r/innodb_mysql_lock.result
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@sun.com>2009-12-08 14:27:33 +0100
committerJon Olav Hauglid <jon.hauglid@sun.com>2009-12-08 14:27:33 +0100
commit5ce2421bb14740fe3d647e0fab04a5d44aaa4d1f (patch)
tree3d32eea9f9af9fe086e56be5db2af9e41fa0a636 /mysql-test/r/innodb_mysql_lock.result
parent8da6d448b4451cf272ff1d3f1600e2a63e33e0c7 (diff)
downloadmariadb-git-5ce2421bb14740fe3d647e0fab04a5d44aaa4d1f.tar.gz
Backport of revno: 2617.65.1
Bug #22876 Four-way deadlock This bug was fixed as a part of Bug#989 "If DROP TABLE while there's an active transaction, wrong binlog order" A statement which would have caused circular wait will now be aborted with ER_LOCK_DEADLOCK. Test case based on bug description added to innodb_mysql_lock.test. Note that innodb_lock_wait_timeout is set to 5 mins to prevent race conditions in the test.
Diffstat (limited to 'mysql-test/r/innodb_mysql_lock.result')
-rw-r--r--mysql-test/r/innodb_mysql_lock.result24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_mysql_lock.result b/mysql-test/r/innodb_mysql_lock.result
new file mode 100644
index 00000000000..147267d5550
--- /dev/null
+++ b/mysql-test/r/innodb_mysql_lock.result
@@ -0,0 +1,24 @@
+#
+# Bug #22876 Four-way deadlock
+#
+DROP TABLE IF EXISTS t1;
+# Connection 1
+set @@autocommit=0;
+CREATE TABLE t1(s1 INT UNIQUE) ENGINE=innodb;
+INSERT INTO t1 VALUES (1);
+# Connection 2
+set @@autocommit=0;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (1);
+# Connection 3
+set @@autocommit=0;
+DROP TABLE t1;
+# Connection 1
+# Connection 1 is now holding the lock.
+# Issuing insert from connection 1 while connection 2&3
+# is waiting for the lock should give a deadlock error.
+INSERT INTO t1 VALUES (2);
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+# Cleanup
+commit;
+commit;