summaryrefslogtreecommitdiff
path: root/mysql-test/main/order_by.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/order_by.test')
-rw-r--r--mysql-test/main/order_by.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test
index fbdf193269f..4cdd8d0b1c2 100644
--- a/mysql-test/main/order_by.test
+++ b/mysql-test/main/order_by.test
@@ -2295,6 +2295,22 @@ SET max_sort_length= @save_max_sort_length;
SET sql_select_limit= @save_sql_select_limit;
DROP TABLE t1;
+--echo #
+--echo # MDEV-25682: EXPLAIN for SELECT with ORDER BY after [ORDER BY] LIMIT
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1);
+explain (select a from t1 limit 2) order by a desc;
+(select a from t1 limit 2) order by a desc;
+
+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;
+(select b,a from t2 order by a limit 3) order by b desc;
+
+drop table t1,t2;
+
--echo # End of 10.2 tests
--echo #