1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-26903: Assertion ctx->trx->state == TRX_STATE_ACTIVE on DROP INDEX

rollback_inplace_alter_table(): Tolerate a case where the transaction
is not in an active state. If ha_innobase::commit_inplace_alter_table()
failed with a deadlock, the transaction would already have been
rolled back. This omission of error handling was introduced in
commit 1bd681c8b3 (MDEV-25506 part 3).

After commit c3c53926c4 (MDEV-26554)
it became easier to trigger DB_DEADLOCK during exclusive table lock
acquisition in ha_innobase::commit_inplace_alter_table().

lock_table_low(): Add DBUG injection "innodb_table_deadlock".
This commit is contained in:
Marko Mäkelä
2021-10-26 09:54:37 +03:00
parent 1193a793c4
commit 58fe6b47d4
4 changed files with 25 additions and 0 deletions

View File

@@ -132,4 +132,14 @@ ALTER TABLE t1 RENAME KEY idx TO idx1, ALGORITHM=COPY;
disconnect con1;
connection default;
DROP TABLE t1;
#
# MDEV-26903 Assertion ctx->trx->state == TRX_STATE_ACTIVE on DROP INDEX
#
CREATE TABLE t1(a INT PRIMARY KEY, b INT, INDEX(b)) ENGINE=InnoDB;
SET @save_dbug=@@debug_dbug;
SET debug_dbug='+d,innodb_table_deadlock';
ALTER TABLE t1 DROP INDEX b, ALGORITHM=INPLACE;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET debug_dbug=@save_dbug;
DROP TABLE t1;
# End of 10.6 tests