mariadb/mysql-test/suite/binlog_in_engine/online_alter.test
Kristian Nielsen 019b2e7ba6 Binlog-in-engine: Assertion on parallel online alter
The online alter feature registers an extra storage engine handlerton on
transactions concurrent with the ALTER. This storage engine looks like it is
2-phase commit capable (though it is not really, recover() is empty). This
caused the binlog code to attempt to do a cross-engine two-phase commit
transaction, and this code is not ready yet.

But the online alter storage engine does not modify any transaction data, it
is a read-online participant. Fix is to only consider read-write
participating transactions for switching to two-phase commit.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-01-16 14:57:13 +01:00

35 lines
764 B
Text

--source include/have_binlog_format_mixed.inc
--source include/have_debug_sync.inc
--source include/have_innodb_binlog.inc
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
--connect (con1,localhost,root,,)
SET debug_sync= 'alter_table_online_downgraded SIGNAL ready WAIT_FOR cont';
send ALTER TABLE t1 FORCE, ALGORITHM=COPY;
--connection default
SET debug_sync= 'now WAIT_FOR ready';
--connect (con2,localhost,root,,)
BEGIN;
INSERT INTO t1 VALUES (6);
--connection default
SET debug_sync= 'now SIGNAL cont';
--connection con2
INSERT INTO t1 VALUES (7);
COMMIT;
send INSERT INTO t1 VALUES (8);
--connection con1
reap;
SET debug_sync= 'RESET';
--connection con2
reap;
SELECT COUNT(*) FROM t1;
DROP TABLE t1;