diff options
Diffstat (limited to 'mysql-test/t/order_by_innodb.test')
-rw-r--r-- | mysql-test/t/order_by_innodb.test | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/t/order_by_innodb.test b/mysql-test/t/order_by_innodb.test index 0debb777749..f4c738263ae 100644 --- a/mysql-test/t/order_by_innodb.test +++ b/mysql-test/t/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 |