diff options
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 55bcf868690..9bf786dbbd4 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -372,7 +372,9 @@ bool Item_sum::collect_outer_ref_processor(uchar *param) { Collect_deps_prm *prm= (Collect_deps_prm *)param; SELECT_LEX *ds; - if ((ds= depended_from()) && ds->nest_level < prm->nest_level) + if ((ds= depended_from()) && + ds->nest_level_base == prm->nest_level_base && + ds->nest_level < prm->nest_level) prm->parameters->add_unique(this, &cmp_items); return FALSE; } |