Skip to content
Permalink
Browse files
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.
  • Loading branch information
Thirunarayanan committed May 23, 2021
1 parent c88e934 commit 98f7b2c
Showing 1 changed file with 6 additions and 1 deletion.
@@ -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: */

0 comments on commit 98f7b2c

Please sign in to comment.