From 7148b846738412517bf4998128ba66a277721630 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Wed, 8 Jul 2020 20:43:57 +0530 Subject: MDEV-13694: Wrong result upon GROUP BY with orderby_uses_equalities=on For the case when the SJM scan table is the first table in the join order, then if we want to do the sorting on the SJM scan table, then we need to make sure that we unpack the values to base table fields in two cases: 1) Reading the SJM table and writing the sort-keys inside the sort-buffer 2) Reading the sorted data from the sort file --- sql/sql_sort.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/sql_sort.h') diff --git a/sql/sql_sort.h b/sql/sql_sort.h index 40f0c5ede5f..3230052dd84 100644 --- a/sql/sql_sort.h +++ b/sql/sql_sort.h @@ -533,6 +533,7 @@ public: Addon_fields *addon_fields; // Descriptors for companion fields. Sort_keys *sort_keys; bool using_pq; + bool set_all_read_bits; uchar *unique_buff; bool not_killable; @@ -553,6 +554,8 @@ public: } void init_for_filesort(uint sortlen, TABLE *table, ha_rows maxrows, bool sort_positions); + + void (*unpack)(TABLE *); /// Enables the packing of addons if possible. void try_to_pack_addons(ulong max_length_for_sort_data); -- cgit v1.2.1