summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthik Kamath <karthik.kamath@oracle.com>2020-08-31 12:21:07 +0530
committerSergei Golubchik <serg@mariadb.org>2020-10-27 09:24:15 +0100
commit1269fd420dbcac2cedb345944a35aebe3562ddc1 (patch)
tree361b1b508c4f53dcce700e5b79a1221e43e74871
parent0c3723e1d50e61303b63f6264c2c193397ee4475 (diff)
downloadmariadb-git-1269fd420dbcac2cedb345944a35aebe3562ddc1.tar.gz
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
-rw-r--r--sql/sql_parse.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index bf1dad804e3..64b9f35d664 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -811,7 +811,6 @@ static void handle_bootstrap_impl(THD *thd)
thd->reset_kill_query(); /* Ensure that killed_errmsg is released */
free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC));
- free_root(&thd->transaction.mem_root,MYF(MY_KEEP_PREALLOC));
thd->lex->restore_set_statement_var();
}