diff options
author | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2022-01-14 15:58:38 +0900 |
---|---|---|
committer | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2022-01-14 15:58:38 +0900 |
commit | 7b0c2a9980937b63ceded4ad84c670e550a086ef (patch) | |
tree | 550e5922cbc42eff010e5c573200dc59dd2bb0d1 /sql/sql_select.cc | |
parent | 2832b949fcd06f7be7fb280df327acbae9797fe8 (diff) | |
download | mariadb-git-bb-10.4-mdev-26345.tar.gz |
Revert "MDEV-26345 SELECT MIN on Spider table returns more rows than expected"bb-10.4-mdev-26345
This reverts commit b9730226dce5bf34b87aa28963f1df68a695a93c.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fa25cdc98ad..9311eb4fa18 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3278,12 +3278,13 @@ bool JOIN::make_aggr_tables_info() /* Check if the storage engine can intercept the query. - The query optimizer might optimize away aggregation functins or DISTINCT. - In such a cage, we need to notify a storage engine supporting a group by - handler of the existence of the original explicit or implicit grouping. - Thus, we set select_distinct || implicit_grouping to Query::distinct. + JOIN::optimize_stage2() might convert DISTINCT into GROUP BY and then + optimize away GROUP BY (group_list). In such a case, we need to notify + a storage engine supporting a group by handler of the existence of the + original DISTINCT. Thus, we set select_distinct || group_optimized_away + to Query::distinct. */ - Query query= {&all_fields, select_distinct || implicit_grouping, tables_list, + Query query= {&all_fields, select_distinct || group_optimized_away, tables_list, conds, group_list, order ? order : group_list, having}; group_by_handler *gbh= ht->create_group_by(thd, &query); |