mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
7b9486d2eb
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.
31 lines
977 B
Text
31 lines
977 B
Text
--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;
|