From ffac85482b0de13d7780b47edd2a5d5947b528dd Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 1 Jul 2016 16:44:17 +0200 Subject: MDEV-8989 ORDER BY optimizer ignores equality propagation Restore the fix from the commit 99cd5a9 that was lost in a merge. --- sql/filesort.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sql/filesort.h') diff --git a/sql/filesort.h b/sql/filesort.h index 18029a10c14..2b4f7ac2654 100644 --- a/sql/filesort.h +++ b/sql/filesort.h @@ -26,6 +26,7 @@ struct TABLE; class Filesort_tracker; struct SORT_FIELD; typedef struct st_order ORDER; +class JOIN; /** @@ -72,7 +73,7 @@ public: ~Filesort() { cleanup(); } /* Prepare ORDER BY list for sorting. */ - uint make_sortorder(THD *thd); + uint make_sortorder(THD *thd, JOIN *join, table_map first_table_bit); private: void cleanup(); @@ -152,11 +153,13 @@ public: { return filesort_buffer.sort_buffer_size(); } friend SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, - Filesort_tracker* tracker); + Filesort_tracker* tracker, JOIN *join, + table_map first_table_bit); }; SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, - Filesort_tracker* tracker); + Filesort_tracker* tracker, JOIN *join=NULL, + table_map first_table_bit=0); void change_double_for_sort(double nr,uchar *to); -- cgit v1.2.1