diff options
author | Sergei Golubchik <serg@mariadb.org> | 2014-08-18 21:36:11 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2014-10-10 22:27:39 +0200 |
commit | d7c1e0ebbd272d6198733e8a71f1c16548733262 (patch) | |
tree | 3dcc2742c491e01b9eed59aac53b713b1a122985 /sql/sp_head.cc | |
parent | a99af484cd9360c2cea92798bcde594adcf23b7e (diff) | |
download | mariadb-git-d7c1e0ebbd272d6198733e8a71f1c16548733262.tar.gz |
MDEV-5317 Compound statement / anonymous blocks
originally based on the patch by Antony T Curtis
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 71502200841..3d1b7b662db 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -577,6 +577,7 @@ sp_head::sp_head() :Query_arena(&main_mem_root, STMT_INITIALIZED_FOR_SP), m_flags(0), m_sp_cache_version(0), + m_creation_ctx(0), unsafe_flags(0), m_recursion_level(0), m_next_cached_sp(0), @@ -1237,7 +1238,8 @@ sp_head::execute(THD *thd, bool merge_da_on_success) Switch query context. This has to be done early as this is sometimes allocated trough sql_alloc */ - saved_creation_ctx= m_creation_ctx->set_n_backup(thd); + if (m_creation_ctx) + saved_creation_ctx= m_creation_ctx->set_n_backup(thd); /* We have to save/restore this info when we are changing call level to @@ -1401,7 +1403,8 @@ sp_head::execute(THD *thd, bool merge_da_on_success) /* Restore query context. */ - m_creation_ctx->restore_env(thd, saved_creation_ctx); + if (m_creation_ctx) + m_creation_ctx->restore_env(thd, saved_creation_ctx); /* Restore arena. */ @@ -2326,6 +2329,9 @@ sp_head::restore_lex(THD *thd) procedures) to multiset of tables used by this routine. */ merge_table_list(thd, sublex->query_tables, sublex); + /* Merge lists of PS parameters. */ + oldlex->param_list.append(&sublex->param_list); + if (! sublex->sp_lex_in_use) { sublex->sphead= NULL; |