summaryrefslogtreecommitdiff
path: root/mysql-test/t/range.test
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@sun.com>2010-06-06 13:19:29 +0200
committerJon Olav Hauglid <jon.hauglid@sun.com>2010-06-06 13:19:29 +0200
commit142a162c665704ce5b4d5b671d05a068661c088a (patch)
treedef1ebab09889a8f09a9fcd074c8a672689376af /mysql-test/t/range.test
parentcbf4019a1b3ec82bdcd9a65db114908a920fb01c (diff)
parent60a9d9bbb94ac03159bcc2d75b649abb1c9dc956 (diff)
downloadmariadb-git-142a162c665704ce5b4d5b671d05a068661c088a.tar.gz
manual merge from mysql-trunk-bugfixing
Conflicts: Text conflict in mysql-test/r/archive.result Contents conflict in mysql-test/r/innodb_bug38231.result Text conflict in mysql-test/r/mdl_sync.result Text conflict in mysql-test/suite/binlog/t/disabled.def Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result Text conflict in mysql-test/t/archive.test Contents conflict in mysql-test/t/innodb_bug38231.test Text conflict in mysql-test/t/mdl_sync.test Text conflict in sql/sp_head.cc Text conflict in sql/sql_show.cc Text conflict in sql/table.cc Text conflict in sql/table.h
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r--mysql-test/t/range.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 5d5ad180f1a..2d2a6f75d73 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -1313,4 +1313,45 @@ SELECT * FROM t1 FORCE INDEX (PRIMARY)
DROP TABLE t1;
+--echo #
+--echo # Bug#50939: Loose Index Scan unduly relies on engine to remember range
+--echo # endpoints
+--echo #
+CREATE TABLE t1 (
+ a INT,
+ b INT,
+ KEY ( a, b )
+) PARTITION BY HASH (a) PARTITIONS 1;
+
+CREATE TABLE t2 (
+ a INT,
+ b INT,
+ KEY ( a, b )
+);
+
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+
+INSERT INTO t1 SELECT a + 5, b + 5 FROM t1;
+INSERT INTO t1 SELECT a + 10, b + 10 FROM t1;
+INSERT INTO t1 SELECT a + 20, b + 20 FROM t1;
+INSERT INTO t1 SELECT a + 40, b + 40 FROM t1;
+
+INSERT INTO t2 SELECT * FROM t1;
+
+--echo # plans should be identical
+EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a;
+EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
+
+FLUSH status;
+SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a;
+--echo # Should be no more than 4 reads.
+SHOW status LIKE 'handler_read_key';
+
+FLUSH status;
+SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a;
+--echo # Should be no more than 4 reads.
+SHOW status LIKE 'handler_read_key';
+
+DROP TABLE t1, t2;
+
--echo End of 5.1 tests