diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-05-14 14:13:59 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-05-23 15:53:59 +0530 |
commit | 98f7b2cb09d73758e3f2af6d57b6e0a804387d3e (patch) | |
tree | b57537ae49b1379d3d799673ee552e9696438b63 /storage/innobase | |
parent | c88e9342f37fff6d7757e4f7c6dcc5a7c44e2217 (diff) | |
download | mariadb-git-98f7b2cb09d73758e3f2af6d57b6e0a804387d3e.tar.gz |
MDEV-25663 Double free of transaction during truncate operation
InnoDB truncate table fails to load the fts stopword table into
cache. In that case, InnoDB double frees the truncate creation
transaction. InnoDB should free the transaction which was
created inside ha_innobase::create.
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b7c6fa98b1c..f19bde12714 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -13024,7 +13024,6 @@ create_table_info_t::create_table_update_dict() if (!innobase_fts_load_stopword(innobase_table, NULL, m_thd)) { dict_table_close(innobase_table, FALSE, FALSE); srv_active_wake_master_thread(); - trx_free_for_mysql(m_trx); DBUG_RETURN(-1); } @@ -13169,6 +13168,12 @@ 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()); + } + /* Tell the InnoDB server that there might be work for utility threads: */ |