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.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 72de21ee483..ffac6dbb912 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -428,7 +428,8 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref)
sl= sl->master_unit()->outer_select() )
sl->master_unit()->item->with_flags|= item_with_t::SUM_FUNC;
}
- thd->lex->current_select->mark_as_dependent(thd, aggr_sel, NULL);
+ if (aggr_sel)
+ thd->lex->current_select->mark_as_dependent(thd, aggr_sel, NULL);
if ((thd->lex->describe & DESCRIBE_EXTENDED) && aggr_sel)
{