diff options
author | Alexander Nozdrin <alik@sun.com> | 2010-05-28 09:47:58 +0400 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2010-05-28 09:47:58 +0400 |
commit | 4e633ec2342754594fad8937a2d12615e5e5cb96 (patch) | |
tree | 88543c956886365a2376e01ce26a0436c38a4454 /sql/sp_head.cc | |
parent | 87dfc8ef1ddf9cfebf535fbfce70152ce3ee6c23 (diff) | |
parent | f54464035a4bfae7c7297e7fe1a8ba7e76ea6585 (diff) | |
download | mariadb-git-4e633ec2342754594fad8937a2d12615e5e5cb96.tar.gz |
Auto-merge from mysql-trunk.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 2e66aec91e5..06918e42e47 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -747,21 +747,12 @@ create_typelib(MEM_ROOT *mem_root, Create_field *field_def, List<String> *src) sp_head::~sp_head() { + LEX *lex; + sp_instr *i; DBUG_ENTER("sp_head::~sp_head"); - destroy(); - delete m_next_cached_sp; - if (m_thd) - restore_thd_mem_root(m_thd); - DBUG_VOID_RETURN; -} -void -sp_head::destroy() -{ - sp_instr *i; - LEX *lex; - DBUG_ENTER("sp_head::destroy"); - DBUG_PRINT("info", ("name: %s", m_name.str)); + /* sp_head::restore_thd_mem_root() must already have been called. */ + DBUG_ASSERT(m_thd == NULL); for (uint ip = 0 ; (i = get_instr(ip)) ; ip++) delete i; @@ -772,21 +763,22 @@ sp_head::destroy() /* If we have non-empty LEX stack then we just came out of parser with error. Now we should delete all auxilary LEXes and restore original - THD::lex (In this case sp_head::restore_thd_mem_root() was not called - too, so m_thd points to the current thread context). - It is safe to not update LEX::ptr because further query string parsing - and execution will be stopped anyway. + THD::lex. It is safe to not update LEX::ptr because further query + string parsing and execution will be stopped anyway. */ - DBUG_ASSERT(m_lex.is_empty() || m_thd); while ((lex= (LEX *)m_lex.pop())) { - lex_end(m_thd->lex); - delete m_thd->lex; - m_thd->lex= lex; + THD *thd= lex->thd; + lex_end(thd->lex); + delete thd->lex; + thd->lex= lex; } my_hash_free(&m_sptabs); my_hash_free(&m_sroutines); + + delete m_next_cached_sp; + DBUG_VOID_RETURN; } @@ -3051,6 +3043,7 @@ int sp_instr_set_trigger_field::execute(THD *thd, uint *nextp) { DBUG_ENTER("sp_instr_set_trigger_field::execute"); + thd->count_cuted_fields= CHECK_FIELD_ERROR_FOR_NULL; DBUG_RETURN(m_lex_keeper.reset_lex_and_exec_core(thd, nextp, TRUE, this)); } |