diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-06-21 13:26:53 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-06-21 13:26:53 +0400 |
commit | af5e128e50cac8881f7bfca44cc473600abdce86 (patch) | |
tree | c3e235b5b5e6bdf5c0fa1e654f707001ee98dec3 /sql/sp_head.cc | |
parent | ab4a13b2b91e260d8c75a3c41b7ff5c24747cee0 (diff) | |
download | mariadb-git-af5e128e50cac8881f7bfca44cc473600abdce86.tar.gz |
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Handle statements inside SPs:
= regular statements
= SET command, which does not have its own statement.
- Handle execution of subquery from range optimizer:
allocate subquery QPFs on the same MEM_ROOT as the whole
query plan was allocated.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 6 |
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; |