mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fix for yet another memleak caused by SP-locking patch.
Improved handling of situations when we encounter error during CREATE PROCEDURE (FUNCTION/TRIGGER/...) and bail out of yyparse() without restoring proper THD::lex. sql/sp.cc: We do not need to call sp_head::restore_lex() explicitly to restore right value of THD::lex in case when we have encountered error during parsing. Now we do this in sp_head::~sp_head() instead. sql/sp_head.cc: sp_head::destroy(): Fixed cleaning up of stack of auxilary LEXes. We also restore right value of THD::lex during this process now. sql/sql_parse.cc: We do not need to call sp_head::restore_lex() explicitly to restore right value of THD::lex in case when we have encountered error during parsing. Now we do this in sp_head::~sp_head() instead. sql/sql_prepare.cc: We do not need to call sp_head::restore_lex() explicitly to restore right value of THD::lex in case when we have encountered error during parsing. Now we do this in sp_head::~sp_head() instead. sql/sql_trigger.cc: We do not need to call sp_head::restore_lex() explicitly to restore right value of THD::lex in case when we have encountered error during parsing. Now we do this in sp_head::~sp_head() instead.
This commit is contained in:
@@ -415,9 +415,8 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
|
||||
*/
|
||||
if (lex.sphead)
|
||||
{
|
||||
if (&lex != thd->lex)
|
||||
thd->lex->sphead->restore_lex(thd);
|
||||
delete lex.sphead;
|
||||
lex.sphead= 0;
|
||||
}
|
||||
goto err_with_lex_cleanup;
|
||||
}
|
||||
|
Reference in New Issue
Block a user