summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-01-21 20:32:48 +0200
committerMonty <monty@mariadb.org>2018-01-21 20:32:48 +0200
commit27a5d96bcb6c4a13284934e3bc409f9c5142885c (patch)
tree76806150200cfef9838f2c70e5c1e577f5a0a349 /sql/sp_rcontext.cc
parentc6cd64f3cb4202fdadeb470fe28f6c50e337f460 (diff)
parent6b7dcefdc83c4444ac8a4623b46810ff940528db (diff)
downloadmariadb-git-27a5d96bcb6c4a13284934e3bc409f9c5142885c.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Conflicts: sql/sp_rcontext.cc
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r--sql/sp_rcontext.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index d82fffc69b0..62b5439d84d 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -68,6 +68,7 @@ sp_rcontext *sp_rcontext::create(THD *thd,
Field *return_value_fld,
Row_definition_list &field_def_lst)
{
+ SELECT_LEX *save_current_select;
sp_rcontext *ctx= new (thd->mem_root) sp_rcontext(owner,
root_parsing_ctx,
return_value_fld,
@@ -75,14 +76,19 @@ sp_rcontext *sp_rcontext::create(THD *thd,
if (!ctx)
return NULL;
+ /* Reset current_select as it's checked in Item_ident::Item_ident */
+ save_current_select= thd->lex->current_select;
+ thd->lex->current_select= 0;
+
if (ctx->alloc_arrays(thd) ||
ctx->init_var_table(thd, field_def_lst) ||
ctx->init_var_items(thd, field_def_lst))
{
delete ctx;
- return NULL;
+ ctx= 0;
}
+ thd->lex->current_select= save_current_select;
return ctx;
}