summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2014-09-30 19:22:27 +0400
committerSergei Petrunia <psergey@askmonty.org>2014-09-30 19:22:27 +0400
commit605b48d3e311e783ff60644dd468bbabb9a4a15c (patch)
tree5a2e1009c6334934ff339131e9225f3cf187dd4a /sql/sql_select.cc
parent0b15557c8fec3de5c3ef3cce2b5ff9340159751f (diff)
downloadmariadb-git-bb-10.1-orderby-fixes.tar.gz
MDEV-6814: Server crashes in calculate_key_len on query with ORDER BYbb-10.1-orderby-fixes
- if test_if_skip_sort_order() decides to switch to using an index, or switch from using ref to using quick select, it should set all members accordingly.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index cf29abcf101..1cf7b851671 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -20177,6 +20177,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
tab->ref.key= -1;
tab->ref.key_parts= 0;
tab->use_quick= 1;
+ best_key= new_ref_key;
/*
We don't restore select->cond as we want to use the
original condition as index condition pushdown is not