diff -ur orig-mysql-8.0.35/mysql-test/t/order_by_limit.test mysql-8.0.35/mysql-test/t/order_by_limit.test --- orig-mysql-8.0.35/mysql-test/t/order_by_limit.test 2023-10-12 07:45:01 +++ mysql-8.0.35/mysql-test/t/order_by_limit.test 2023-12-24 17:41:55 @@ -299,6 +299,13 @@ --skip_if_hypergraph # Does not output the same optimizer trace. SELECT (trace LIKE '%"plan_changed": true%') AS should_be_1 FROM information_schema.optimizer_trace; +#echo "With prefer_ordering_index=off, ordering index is picked when" +#echo "there is no other suitable index." +SET optimizer_switch = "prefer_ordering_index=off"; +EXPLAIN SELECT non_covered_column FROM t ORDER BY id LIMIT 1; +--skip_if_hypergraph # Does not output the same optimizer trace. +SELECT (trace LIKE '%"plan_changed": false%') AS should_be_0 FROM information_schema.optimizer_trace; + #Insert some more data for group by let $n = 10; while ($n)