summaryrefslogtreecommitdiff
path: root/mysql-test/main/order_by_innodb.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-09-23 10:25:34 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-09-23 10:25:34 +0300
commitc016ea660ede8b7ff75f8ca65f73e2958262263a (patch)
treec8bc8579c738792f0769ea70f49348dc1baf51b3 /mysql-test/main/order_by_innodb.test
parent1bbe8c5e0f6823acd4780d7563e8c02f8b4c5a01 (diff)
parent2931fd2917cc130e34e5f3d9d6c571a2b013e49c (diff)
downloadmariadb-git-c016ea660ede8b7ff75f8ca65f73e2958262263a.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/order_by_innodb.test')
-rw-r--r--mysql-test/main/order_by_innodb.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/main/order_by_innodb.test b/mysql-test/main/order_by_innodb.test
index 0debb777749..f4c738263ae 100644
--- a/mysql-test/main/order_by_innodb.test
+++ b/mysql-test/main/order_by_innodb.test
@@ -63,6 +63,32 @@ where key1<3 or key2<3;
drop table t0, t1;
--echo #
+--echo # MDEV-18094: Query with order by limit picking index scan over filesort
+--echo #
+
+create table t0 (a int);
+INSERT INTO t0 VALUES (0),(0),(0),(0),(2),(0),(0),(1),(1),(0);
+
+CREATE TABLE t1 (
+a int(11),
+b int(11),
+c int(11),
+KEY a_c (a,c),
+KEY a_b (a,b)
+) ENGINE=InnoDB;
+insert into t1 select A.a , B.a, C.a from t0 A, t0 B, t0 C;
+
+--echo # should use ref access
+explain select a,b,c from t1 where a=1 and c=2 order by b;
+
+--echo # both should use range access
+explain select a,b,c from t1 where a=1 and c=2 order by b limit 1000;
+explain select a,b,c from t1 where a=1 and c=2 order by b limit 2000;
+drop table t1,t0;
+
+--echo # Start of 10.2 tests
+
+--echo #
--echo # MDEV-14071: wrong results with orderby_uses_equalities=on
--echo # (duplicate of MDEV-13994)
--echo #
@@ -108,3 +134,5 @@ eval $q2;
set optimizer_switch= @save_optimizer_switch;
DROP TABLE t1,t2,t3;
+
+--echo # End of 10.2 tests