--source include/have_debug.inc connect (con1,localhost,root,,); # Prepare Data DELIMITER |; CREATE PROCEDURE InsertIncrementData(IN max_id INT) BEGIN DECLARE current_id INT DEFAULT 0; DECLARE current_k VARCHAR(700); WHILE current_id <= max_id DO SET current_k = LPAD(current_id, 700, '0'); INSERT INTO t2 (id, k) VALUES (current_id, current_k); SET current_id = current_id + 1; END WHILE; END | DELIMITER ;| create table t2 (id int primary key, k varchar(700), unique key k_1 (k)); CALL InsertIncrementData(100); connection default; SET DEBUG_SYNC = 'RESET'; SET DEBUG_SYNC = 'row_log_apply_before SIGNAL s1 WAIT_FOR s2'; --send ALTER TABLE t2 ADD unique key (k), ALGORITHM=INPLACE, LOCK=NONE connection con1; SET DEBUG_SYNC = 'now WAIT_FOR s1'; # id=22 in online uk is the first row in a leaf page. delete from t2 where id=22; insert into t2 values (22, LPAD(22,700,'0')); SET DEBUG_SYNC = 'now SIGNAL s2'; connection default; # Should not receive duplicate key error --reap #Cleanup DROP TABLE t2; DROP PROCEDURE InsertIncrementData;