mariadb/mysql-test/suite/innodb/t/insert_into_empty_debug.test
Thirunarayanan Balathandayuthapani 7c0b9c6020 MDEV-15250 UPSERT during ALTER TABLE results in 'Duplicate entry' error for alter
- InnoDB should avoid bulk insert operation when table has active
DDL. Because bulk insert writes only one undo log as TRX_UNDO_EMPTY
and logging of concurrent DML happens at commit time uses undo log
record to parse and get the value and operation.

- Removed ROW_T_EMPTY, ROW_OP_EMPTY and their associated functions
and also the test case which tries to log the ROW_OP_EMPTY
when table has active DDL.
2022-04-26 16:22:56 +05:30

36 lines
868 B
Text

--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
# Encounter aborted online index during rollback of bulk insert
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
PRIMARY KEY(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 2), (2, 2);
SET DEBUG_SYNC="innodb_rollback_inplace_alter_table SIGNAL dml_start WAIT_FOR dml_commit";
send ALTER TABLE t1 ADD UNIQUE KEY(f2);
connect(con1,localhost,root,,,);
SET DEBUG_SYNC="now WAIT_FOR dml_start";
BEGIN;
DELETE FROM t1;
SET DEBUG_SYNC="now SIGNAL dml_commit";
connection default;
--error ER_DUP_ENTRY
reap;
connection con1;
COMMIT;
TRUNCATE TABLE t1;
SET unique_checks=0, foreign_key_checks=0;
BEGIN;
INSERT INTO t1 VALUES(1, 2);
ROLLBACK;
connection default;
SELECT * FROM t1;
SHOW CREATE TABLE t1;
disconnect con1;
DROP TABLE t1;
SET DEBUG_SYNC=RESET;