2020-07-23 17:41:44 +03:00
|
|
|
--source innodb_default_row_format.inc
|
|
|
|
--source include/have_debug.inc
|
|
|
|
--source include/have_debug_sync.inc
|
|
|
|
|
|
|
|
--echo #
|
|
|
|
--echo # MDEV-23244 ALTER TABLE…ADD PRIMARY KEY fails to flag
|
|
|
|
--echo # duplicate key error from concurrent DML
|
|
|
|
--echo #
|
|
|
|
|
|
|
|
CREATE TABLE t0 (pk INT PRIMARY KEY) ENGINE=InnoDB;
|
|
|
|
CREATE TABLE t1 (c CHAR(2) NOT NULL) ENGINE=InnoDB;
|
2021-11-12 17:46:35 +05:30
|
|
|
INSERT INTO t1 VALUES('cd');
|
2020-07-23 17:41:44 +03:00
|
|
|
|
|
|
|
connect (con1,localhost,root,,);
|
|
|
|
BEGIN;
|
|
|
|
INSERT INTO t0 VALUES(1);
|
|
|
|
|
|
|
|
connection default;
|
|
|
|
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done';
|
|
|
|
send ALTER TABLE t1 ADD PRIMARY KEY(c(1));
|
|
|
|
|
|
|
|
connection con1;
|
|
|
|
SET DEBUG_SYNC='now WAIT_FOR dml';
|
|
|
|
INSERT INTO t1 VALUES ('ab'),('ac');
|
|
|
|
COMMIT;
|
|
|
|
SET DEBUG_SYNC='now SIGNAL dml_done';
|
|
|
|
disconnect con1;
|
|
|
|
|
|
|
|
connection default;
|
|
|
|
--error ER_DUP_ENTRY
|
|
|
|
reap;
|
|
|
|
SET DEBUG_SYNC='RESET';
|
|
|
|
|
|
|
|
SELECT * FROM t1;
|
|
|
|
DROP TABLE t0,t1;
|