1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge 10.5 into 10.6

This commit is contained in:
Marko Mäkelä
2023-07-05 16:40:22 +03:00
12 changed files with 187 additions and 38 deletions

View File

@@ -486,11 +486,15 @@ bool sp_create_assignment_instr(THD *thd, bool no_lookahead,
be deleted by the destructor ~sp_instr_xxx().
So we should remove "lex" from the stack sp_head::m_lex,
to avoid double free.
Note, in case "lex" is not owned by any sp_instr_xxx,
it's also safe to remove it from the stack right now.
So we can remove it unconditionally, without testing lex->sp_lex_in_use.
*/
lex->sphead->restore_lex(thd);
/*
No needs for "delete lex" here: "lex" is already linked
to the sp_instr_stmt (using sp_lex_keeper) instance created by
the call for new_sp_instr_stmt() above. It will be freed
by ~sp_head/~sp_instr/~sp_lex_keeper during THD::end_statement().
*/
DBUG_ASSERT(lex->sp_lex_in_use); // used by sp_instr_stmt
return true;
}
enum_var_type inner_option_type= lex->option_type;
@@ -6843,7 +6847,6 @@ bool LEX::sp_for_loop_implicit_cursor_statement(THD *thd,
if (unlikely(!(bounds->m_index=
new (thd->mem_root) sp_assignment_lex(thd, this))))
return true;
bounds->m_index->sp_lex_in_use= true;
sphead->reset_lex(thd, bounds->m_index);
DBUG_ASSERT(thd->lex != this);
/*