summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index dad7b804e7e..23214020486 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -8987,7 +8987,13 @@ push_new_name_resolution_context(THD *thd,
left_op->first_leaf_for_name_resolution();
on_context->last_name_resolution_table=
right_op->last_leaf_for_name_resolution();
- return thd->lex->push_context(on_context);
+ LEX *lex= thd->lex;
+ on_context->select_lex = lex->current_select;
+ st_select_lex *curr_select= lex->pop_select();
+ st_select_lex *outer_sel= lex->select_stack_head();
+ lex->push_select(curr_select);
+ on_context->outer_context = outer_sel ? &outer_sel->context : 0;
+ return lex->push_context(on_context);
}