forked from MariaDB/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-14693 XA: Assertion `!clust_index->online_log' failed in rollbac…
…k_inplace_alter_table ha_innobase::commit_inplace_alter_table(): Defer the freeing of ctx->trx until after the operation has been successfully committed. In this way, rollback on a partitioned table will be possible. rollback_inplace_alter_table(): Handle ctx->new_table == NULL when ctx->trx != NULL.
- Loading branch information
Showing
4 changed files
with
104 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# | ||
# MDEV-14693 XA: Assertion `!clust_index->online_log' failed | ||
# in rollback_inplace_alter_table | ||
# | ||
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2; | ||
XA START 'xid'; | ||
INSERT INTO t1 VALUES (1,10); | ||
CREATE DATABASE IF NOT EXISTS db; | ||
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state | ||
SET innodb_lock_wait_timeout= 1, lock_wait_timeout= 2; | ||
ALTER TABLE t1 FORCE; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
XA END 'xid'; | ||
XA ROLLBACK 'xid'; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--source include/have_innodb.inc | ||
--source include/have_partition.inc | ||
|
||
--echo # | ||
--echo # MDEV-14693 XA: Assertion `!clust_index->online_log' failed | ||
--echo # in rollback_inplace_alter_table | ||
--echo # | ||
|
||
# A bug in meta-data locking (MDL) for XA transactions causes | ||
# a bug in InnoDB error handling for ALTER TABLE to be triggered. | ||
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2; | ||
XA START 'xid'; | ||
INSERT INTO t1 VALUES (1,10); | ||
# XA bug: The following releases the MDL on t1! | ||
--error ER_XAER_RMFAIL | ||
CREATE DATABASE IF NOT EXISTS db; | ||
|
||
--connect (con1,localhost,root,,test) | ||
SET innodb_lock_wait_timeout= 1, lock_wait_timeout= 2; | ||
# Here, innodb_lock_wait_timeout would be exceeded, causing the operation | ||
# to roll back when InnoDB is attempting to commit. | ||
# (Instead, lock_wait_timeout should be exceeded!) | ||
--error ER_LOCK_WAIT_TIMEOUT | ||
ALTER TABLE t1 FORCE; | ||
|
||
# Cleanup | ||
--disconnect con1 | ||
--connection default | ||
XA END 'xid'; | ||
XA ROLLBACK 'xid'; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters