summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <mhansson@dl145s.mysql.com>2007-08-16 14:13:07 +0200
committerunknown <mhansson@dl145s.mysql.com>2007-08-16 14:13:07 +0200
commitf4a163c3a531fecf6cf20c80ce9a7e57d357f11a (patch)
treea052b07d62e341ad24fc20ade392e9e8bc835c7c /mysql-test
parentbbf2211bdcd43581b9ddf54f1bfc731384e289c7 (diff)
parent01f8130aa68392d14f36cc17c01e1b349bf844f5 (diff)
downloadmariadb-git-f4a163c3a531fecf6cf20c80ce9a7e57d357f11a.tar.gz
Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into dl145s.mysql.com:/data0/mhansson/my50-bug28570 sql/opt_range.cc: Auto merged mysql-test/r/innodb_mysql.result: Bug#28570: Manual Merge mysql-test/t/innodb_mysql.test: Bug#28570: Manual Merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/innodb_mysql.result18
-rw-r--r--mysql-test/t/innodb_mysql.test28
2 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 63e25b7aa1e..c93d26bbd04 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1047,4 +1047,22 @@ t1 CREATE TABLE `t1` (
KEY `a` (`a`(255))
) ENGINE=InnoDB DEFAULT CHARSET=utf8
drop table t1;
+CREATE TABLE t1 (
+a INT,
+b INT,
+KEY (b)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,10), (2,10), (2,20), (3,30);
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=20 FOR UPDATE;
+a b
+2 20
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
+a b
+1 10
+2 10
+ROLLBACK;
+ROLLBACK;
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index adcfec68d3e..aecefda93d3 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -881,5 +881,33 @@ insert into t1 values('aaa');
alter table t1 add index(a(1024));
show create table t1;
drop table t1;
+# Bug #28570: handler::index_read() is called with different find_flag when
+# ORDER BY is used
+#
+
+CREATE TABLE t1 (
+ a INT,
+ b INT,
+ KEY (b)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (1,10), (2,10), (2,20), (3,30);
+
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=20 FOR UPDATE;
+
+--connect (conn2, localhost, root,,test)
+
+# This statement gives a "failed: 1205: Lock wait timeout exceeded; try
+# restarting transaction" message when the bug is present.
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
+ROLLBACK;
+
+--disconnect conn2
+--connection default
+
+ROLLBACK;
+DROP TABLE t1;
--echo End of 5.0 tests