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 e50822e71f2..9f68a89a7c8 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -84,7 +84,9 @@ bool Item_sum::init_sum_func_check(THD *thd)
/* Set a reference to the nesting set function if there is any */
in_sum_func= thd->lex->in_sum_func;
/* Save a pointer to object to be used in items for nested set functions */
- thd->lex->in_sum_func= this;
+ if (!window_func_sum_expr_flag)
+ thd->lex->in_sum_func= this;
+
nest_level= thd->lex->current_select->nest_level;
ref_by= 0;
aggr_level= -1;