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.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 3cc3a3893bb..2ad03f3d0dc 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -2973,6 +2973,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
}
reinit_stmt_before_use(thd, m_lex);
+ // not here, but inside every instr: create_qpf_query(m_lex);
if (open_tables)
res= instr->exec_open_and_lock_tables(thd, m_lex->query_tables);
@@ -3007,8 +3008,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
thd->mdl_context.release_statement_locks();
}
- delete_qpf_query(m_lex->query_plan_footprint);
- m_lex->query_plan_footprint= NULL;
+ delete_qpf_query(m_lex);
if (m_lex->query_tables_own_last)
{
@@ -3212,6 +3212,7 @@ sp_instr_set::execute(THD *thd, uint *nextp)
int
sp_instr_set::exec_core(THD *thd, uint *nextp)
{
+ create_qpf_query(thd->lex, thd->mem_root);
int res= thd->spcont->set_variable(thd, m_offset, &m_value);
if (res)
@@ -3224,6 +3225,7 @@ sp_instr_set::exec_core(THD *thd, uint *nextp)
my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
}
}
+ delete_qpf_query(thd->lex);
*nextp = m_ip+1;
return res;