summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-05-23 21:15:01 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-05-23 21:17:18 +0300
commit99cd5a962c53e35620cdeeca35dfab4ab4b3bb4c (patch)
treefeeed1a8f97c3ebbb85af707a3662d0f930944bd /sql/sql_select.h
parent9c9747fed3e1c1a7838e45c71983a3c4bbd3160d (diff)
downloadmariadb-git-99cd5a962c53e35620cdeeca35dfab4ab4b3bb4c.tar.gz
MDEV-8989: ORDER BY optimizer ignores equality propagation
Variant #4 of the fix. Make ORDER BY optimization functions take into account multiple equalities. This is done in several places: - remove_const() checks whether we can sort the first table in the join, or we need to put rows into temp.table and then sort. - test_if_order_by_key() checks whether there are indexes that can be used to produce the required ordering - make_unireg_sortorder() constructs sort criteria for filesort.
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r--sql/sql_select.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 3a0baf03c26..89ee63e87b0 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1821,7 +1821,9 @@ bool error_if_full_join(JOIN *join);
int report_error(TABLE *table, int error);
int safe_index_read(JOIN_TAB *tab);
int get_quick_record(SQL_SELECT *select);
-SORT_FIELD * make_unireg_sortorder(THD *thd, ORDER *order, uint *length,
+SORT_FIELD *make_unireg_sortorder(THD *thd, JOIN *join,
+ table_map first_table_map,
+ ORDER *order, uint *length,
SORT_FIELD *sortorder);
int setup_order(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
List<Item> &fields, List <Item> &all_fields, ORDER *order);