mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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.
This commit is contained in:
@@ -27,35 +27,6 @@ t1 CREATE TABLE `t1` (
|
||||
`f2` int(11) NOT NULL,
|
||||
PRIMARY KEY (`f1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES(1, 1);
|
||||
connection con1;
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
connect con2,localhost,root,,,;
|
||||
DELETE FROM t1;
|
||||
connection default;
|
||||
SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL purge_resume WAIT_FOR dml_commit";
|
||||
ALTER TABLE t1 ADD INDEX(f2, f1);
|
||||
connection con1;
|
||||
COMMIT;
|
||||
connection con2;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
|
||||
InnoDB 1 transactions not purged
|
||||
SET unique_checks=0, foreign_key_checks=0;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES(2, 2);
|
||||
ROLLBACK;
|
||||
SET DEBUG_SYNC="now SIGNAL dml_commit";
|
||||
connection default;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) NOT NULL,
|
||||
`f2` int(11) NOT NULL,
|
||||
PRIMARY KEY (`f1`),
|
||||
KEY `f2` (`f2`,`f1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC=RESET;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=default;
|
||||
|
Reference in New Issue
Block a user