Commit e908e9bc authored by Tor Didriksen's avatar Tor Didriksen

Bug#16192219 CRASH IN TEST_IF_SKIP_SORT_ORDER ON SELECT DISTINCT WITH ORDER BY

This is a backport of the fix for:

Bug#13633549 HANDLE_FATAL_SIGNAL IN TEST_IF_SKIP_SORT_ORDER/CREATE_SORT_INDEX
Don't invoke the range optimizer for a NULL select.
parent 06400b63
...@@ -13753,7 +13753,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, ...@@ -13753,7 +13753,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
if (best_key >= 0) if (best_key >= 0)
{ {
if (table->quick_keys.is_set(best_key) && best_key != ref_key) if (select &&
table->quick_keys.is_set(best_key) && best_key != ref_key)
{ {
key_map map; key_map map;
map.clear_all(); // Force the creation of quick select map.clear_all(); // Force the creation of quick select
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment