summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2010-10-04 13:05:21 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2010-10-04 13:05:21 +0300
commit678bc90ed8b416dbf68f590caae3a3d36c544b12 (patch)
tree42602379722ef8db51e77bb29d8d67321535bca3 /mysql-test
parent282eee8879a735857aaf27e01bcc04b690a4ffcf (diff)
downloadmariadb-git-678bc90ed8b416dbf68f590caae3a3d36c544b12.tar.gz
Bug#56716 InnoDB locks a record gap without locking the table
row_search_for_mysql(): Acquire an intention lock on the table before locking the first record gap.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56716.result4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56716.test10
2 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/innodb_bug56716.result b/mysql-test/suite/innodb/r/innodb_bug56716.result
new file mode 100644
index 00000000000..50d83e8d87a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug56716.result
@@ -0,0 +1,4 @@
+CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
+SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
+a b c
+DROP TABLE bug56716;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56716.test b/mysql-test/suite/innodb/t/innodb_bug56716.test
new file mode 100644
index 00000000000..3345038d9c1
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug56716.test
@@ -0,0 +1,10 @@
+#
+# Bug #56716 InnoDB locks a record gap without locking the table
+#
+-- source include/have_innodb.inc
+
+CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
+
+SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
+
+DROP TABLE bug56716;