summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 58935337aa0..7b6be33d715 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -290,7 +290,9 @@ Item_sum::Item_sum(THD *thd, Item_sum *item):
void Item_sum::mark_as_sum_func()
{
- current_thd->lex->current_select->with_sum_func= 1;
+ SELECT_LEX *cur_select= current_thd->lex->current_select;
+ cur_select->n_sum_items++;
+ cur_select->with_sum_func= 1;
with_sum_func= 1;
}