summaryrefslogtreecommitdiff
path: root/mysql-test/main/order_by.result
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-06-08 16:03:53 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-06-08 16:03:53 +0300
commitf4425d3a3dbe5638daceb41dca4dfdb5eba1ffaf (patch)
tree88134dff388f88041cd557eb53bc262667f51f96 /mysql-test/main/order_by.result
parentbf5c050fd28f616d789a02b0fbd6fd8ff53c78d3 (diff)
parentb8d38c5e39d526e006f4e8e8977ac4c6166bc4c6 (diff)
downloadmariadb-git-f4425d3a3dbe5638daceb41dca4dfdb5eba1ffaf.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'mysql-test/main/order_by.result')
-rw-r--r--mysql-test/main/order_by.result25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result
index 81127121cde..dc29859c112 100644
--- a/mysql-test/main/order_by.result
+++ b/mysql-test/main/order_by.result
@@ -3537,6 +3537,31 @@ SET max_length_for_sort_data=@save_max_length_for_sort_data;
SET max_sort_length= @save_max_sort_length;
SET sql_select_limit= @save_sql_select_limit;
DROP TABLE t1;
+#
+# MDEV-25682: EXPLAIN for SELECT with ORDER BY after [ORDER BY] LIMIT
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+explain (select a from t1 limit 2) order by a desc;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using filesort
+2 DERIVED t1 ALL NULL NULL NULL NULL 3
+(select a from t1 limit 2) order by a desc;
+a
+7
+3
+create table t2 (a int, b int);
+insert into t2 values (3,70), (7,10), (1,40), (4,30);
+explain (select b,a from t2 order by a limit 3) order by b desc;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 Using filesort
+2 DERIVED t2 ALL NULL NULL NULL NULL 4 Using filesort
+(select b,a from t2 order by a limit 3) order by b desc;
+b a
+70 3
+40 1
+30 4
+drop table t1,t2;
# End of 10.2 tests
#
# MDEV-16214: Incorrect plan taken by the optimizer , uses INDEX instead of ref access with ORDER BY