summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-05-17 15:42:36 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-05-17 15:42:36 +0300
commit339a290d220551255f9995372f632d6d65a05e06 (patch)
tree4e5e8e53a6417c094058ad3f0ab1951aae28af04 /sql/opt_sum.cc
parentb87873b221fffccae622d4d52d9d1219e306a98f (diff)
parent934b8312817d4e8e0387fae0bd9cca3ffafbc7de (diff)
downloadmariadb-git-339a290d220551255f9995372f632d6d65a05e06.tar.gz
Merge remote-tracking branch 'origin/5.5' into 10.0
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 1ff1f4a6449..5a5e17dda6d 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -254,6 +254,8 @@ int opt_sum_query(THD *thd,
int error= 0;
DBUG_ENTER("opt_sum_query");
+ thd->lex->current_select->min_max_opt_list.empty();
+
if (conds)
where_tables= conds->used_tables();
@@ -447,7 +449,14 @@ int opt_sum_query(THD *thd,
item_sum->aggregator_clear();
}
else
+ {
item_sum->reset_and_add();
+ /*
+ Save a reference to the item for possible rollback
+ of the min/max optimizations for this select
+ */
+ thd->lex->current_select->min_max_opt_list.push_back(item_sum);
+ }
item_sum->make_const();
recalc_const_item= 1;
break;