Skip to content

Commit 1269fd4

Browse files
karthik-kamathvuvova
authored andcommitted
BUG#31650096: MYSQL SERVER HEAP-USE-AFTER-FREE IN TRANS_SAVEPOINT
ANALYSIS: ========= During Bootstrap, while executing the statements from sql file passed to the init-file server option, transaction mem_root was being freed for every statement. This creates an issue with multi statement transactions especially when a statement in the transaction has to access the memory used by the previous statement in the transaction. FIX: ==== Transaction mem_root is freed whenever a transaction is committed or rolled-back. Hence explicitly freeing it is not necessary in the bootstrap implementation. Change-Id: I40f71d49781bf7ad32d474bb176bd6060c9377dc
1 parent 0c3723e commit 1269fd4

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

sql/sql_parse.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,6 @@ static void handle_bootstrap_impl(THD *thd)
811811

812812
thd->reset_kill_query(); /* Ensure that killed_errmsg is released */
813813
free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC));
814-
free_root(&thd->transaction.mem_root,MYF(MY_KEEP_PREALLOC));
815814
thd->lex->restore_set_statement_var();
816815
}
817816

0 commit comments

Comments
 (0)