mirror of
https://github.com/zebrajr/server.git
synced 2025-12-06 12:20:40 +01:00
MDEV-30393 InnoDB: Assertion failure in dict0dict.cc upon ADD FULLTEXT INDEX
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"
This commit is contained in:
parent
8c2dcfab03
commit
ef6b3806bb
|
|
@ -11273,7 +11273,8 @@ ha_innobase::commit_inplace_alter_table(
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_EXECUTE_IF("stats_lock_fail",
|
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) {
|
if (error == DB_SUCCESS) {
|
||||||
error = lock_sys_tables(trx);
|
error = lock_sys_tables(trx);
|
||||||
|
|
@ -11291,6 +11292,18 @@ ha_innobase::commit_inplace_alter_table(
|
||||||
if (fts_exist) {
|
if (fts_exist) {
|
||||||
purge_sys.resume_FTS();
|
purge_sys.resume_FTS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (trx->state == TRX_STATE_NOT_STARTED) {
|
||||||
|
/* Transaction may have been rolled back
|
||||||
|
due to a lock wait timeout, deadlock,
|
||||||
|
or a KILL statement. So restart the
|
||||||
|
transaction to remove the newly created
|
||||||
|
table or index stubs from data dictionary
|
||||||
|
and table cache in
|
||||||
|
rollback_inplace_alter_table() */
|
||||||
|
trx_start_for_ddl(trx);
|
||||||
|
}
|
||||||
|
|
||||||
DBUG_RETURN(true);
|
DBUG_RETURN(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user