summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-05-24 11:33:01 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2021-05-24 11:33:01 +0530
commit5c75ba9cadc7877e91d6b712f157ff5623c09c60 (patch)
treedf844a2e06a44a489e741bfb933fe9dade3984d9
parent349d77ecdd8ed549005ac000a80e3e0126fbd80a (diff)
downloadmariadb-git-5c75ba9cadc7877e91d6b712f157ff5623c09c60.tar.gz
MDEV-25663 Double free of transaction during truncate operation
- Patch addresses the problem to fix double free of transaction if it is own transaction.
-rw-r--r--storage/innobase/handler/ha_innodb.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index f19bde12714..5617a293a23 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -13155,10 +13155,6 @@ ha_innobase::create(
innobase_commit_low(trx);
row_mysql_unlock_data_dictionary(trx);
- if (own_trx) {
- trx_free_for_mysql(trx);
- }
-
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
with innodb_flush_log_at_trx_commit = 0 */
@@ -13168,10 +13164,8 @@ ha_innobase::create(
error = info.create_table_update_dict();
- /* In case of error, free the transaction only if
- it is newly created transaction in ha_innobase::create() */
- if (own_trx && error) {
- trx_free_for_mysql(info.trx());
+ if (own_trx) {
+ trx_free_for_mysql(trx);
}
/* Tell the InnoDB server that there might be work for