diff -ur orig-mysql-8.0.35/mysql-test/r/order_by_limit.result mysql-8.0.35/mysql-test/r/order_by_limit.result --- orig-mysql-8.0.35/mysql-test/r/order_by_limit.result 2023-10-12 07:45:01 +++ mysql-8.0.35/mysql-test/r/order_by_limit.result 2023-12-24 17:40:39 @@ -385,6 +385,15 @@ SELECT (trace LIKE '%"plan_changed": true%') AS should_be_1 FROM information_schema.optimizer_trace; should_be_1 1 +SET optimizer_switch = "prefer_ordering_index=off"; +EXPLAIN SELECT non_covered_column FROM t ORDER BY id LIMIT 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t NULL index NULL PRIMARY 8 NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t`.`non_covered_column` AS `non_covered_column` from `test`.`t` order by `test`.`t`.`id` limit 1 +SELECT (trace LIKE '%"plan_changed": false%') AS should_be_0 FROM information_schema.optimizer_trace; +should_be_0 +0 INSERT INTO t (id, other_id, covered_column, non_covered_column) VALUES (10+1+10, 10, '10', '10'); INSERT INTO t (id, other_id, covered_column, non_covered_column)