summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 01cebb5fc60..f29ac3b3c9c 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -193,7 +193,12 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
ER_SELECT_REDUCED, warn_buff);
}
substitution= select_lex->item_list.head();
-
+ /*
+ as far as we moved content to upper leven, field which depend of
+ 'upper' select is not really dependent => we remove this dependence
+ */
+ substitution->walk(&Item::remove_dependence_processor,
+ (byte *) select_lex->outer_select());
if (select_lex->where || select_lex->having)
{
Item *cond;