summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 49c8229c277..9e5b5bee0f2 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1211,6 +1211,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
Query_arena execute_arena(&execute_mem_root, STMT_INITIALIZED_FOR_SP),
backup_arena;
query_id_t old_query_id;
+ CSET_STRING old_query;
TABLE *old_derived_tables;
TABLE *old_rec_tables;
LEX *old_lex;
@@ -1291,6 +1292,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
be able properly do close_thread_tables() in instructions.
*/
old_query_id= thd->query_id;
+ old_query= thd->query_string;
old_derived_tables= thd->derived_tables;
thd->derived_tables= 0;
old_rec_tables= thd->rec_tables;
@@ -1567,6 +1569,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
old_change_list.move_elements_to(thd);
thd->lex= old_lex;
thd->set_query_id(old_query_id);
+ thd->set_query_inner(old_query);
DBUG_ASSERT(!thd->derived_tables);
thd->derived_tables= old_derived_tables;
thd->rec_tables= old_rec_tables;