Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions sql/sp_instr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,19 @@ int sp_lex_keeper::validate_lex_and_exec_core(THD *thd, uint *nextp,
m_first_execution= false;

if (!rc)
{
/*
sp_lex_instr is re-parsed after the metadata change, which sets up a new
mem_root for reparsing. Once the sp_lex_instr is reparsed and re-executed
(via reset_lex_and_exec_core) it should be marked as read-only to enforce
sp memory root protection.
*/
#ifdef PROTECT_STATEMENT_MEMROOT
if (rerun_the_same_instr && instr->mem_root)
instr->mem_root->flags |= ROOT_FLAG_READ_ONLY;
#endif
break;
}

/*
Raise the error upper level in case:
Expand Down
Loading