summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2023-01-23 18:06:13 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2023-01-23 18:07:59 +0530
commitbb9f97267aefe595b71ddd310dec0f32dbd2012a (patch)
tree5f76193c6528bdf34f304e372dca9acb30b1d83e
parent851c56771e11d50648430bb47644966996b9aa82 (diff)
downloadmariadb-git-bb9f97267aefe595b71ddd310dec0f32dbd2012a.tar.gz
MDEV-30393 InnoDB: Assertion failure in dict0dict.cc upon ADD FULLTEXT INDEXbb-10.6-MDEV-30393
Problem: ======== - InnoDB fails to remove the newly created table or index from data dictionary and table cache if the alter fails in commit phase Solution: ======== - InnoDB should restart the transaction to remove the newly created table and index when it fails in commit phase of an alter operation. innodb_fts.misc_debug tests the scenario with the help of debug point "stats_lock_fail"
-rw-r--r--storage/innobase/handler/handler0alter.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 8ff36bc4bdd..c7397a9310e 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -11276,7 +11276,8 @@ err_index:
}
DBUG_EXECUTE_IF("stats_lock_fail",
- error = DB_LOCK_WAIT_TIMEOUT;);
+ error = DB_LOCK_WAIT_TIMEOUT;
+ trx_rollback_for_mysql(trx););
if (error == DB_SUCCESS) {
error = lock_sys_tables(trx);
@@ -11294,6 +11295,15 @@ err_index:
if (fts_exist) {
purge_sys.resume_FTS();
}
+
+ /* Rollbacked the transaction.
+ So restart the transaction to remove the
+ newly created table or index from data dictionary
+ and table cache in rollback_inplace_alter_table() */
+ if (trx->state == TRX_STATE_NOT_STARTED) {
+ trx_start_for_ddl(trx);
+ }
+
DBUG_RETURN(true);
}