1CREATE TABLE t (a INT PRIMARY KEY, c TEXT) ENGINE=InnoDB;
2CREATE TABLE u (a INT PRIMARY KEY, b INT, c INT NOT NULL) ENGINE=InnoDB;
3INSERT INTO t VALUES (1,'aa');
4BEGIN;
5INSERT INTO u SET a=1, c=1;
6INSERT INTO u SELECT a+1,NULL,a+1 FROM u;
7INSERT INTO u SELECT a+2,NULL,a+2 FROM u;
8INSERT INTO u SELECT a+4,NULL,a+4 FROM u;
9INSERT INTO u SELECT a+8,NULL,a+8 FROM u;
10INSERT INTO u SELECT a+16,NULL,a+16 FROM u;
11INSERT INTO u SELECT a+32,NULL,a+32 FROM u;
12INSERT INTO u SELECT a+64,NULL,a+64 FROM u;
13INSERT INTO u SELECT a+128,NULL,a+64 FROM u;
14INSERT INTO u SELECT a+256,NULL,a+64 FROM u;
15COMMIT;
16BEGIN;
17DELETE FROM u;
18SET DEBUG_SYNC='row_log_apply_before SIGNAL created_u WAIT_FOR dml_done_u';
19ALTER TABLE u ADD INDEX (c);
20COMMIT;
21SET DEBUG_SYNC='now WAIT_FOR created_u';
22SELECT state FROM information_schema.processlist
23WHERE info='ALTER TABLE u ADD INDEX (c)';
24state
25debug sync point: row_log_apply_before
26SET DEBUG_SYNC='row_log_apply_before SIGNAL created_t WAIT_FOR dml_done_t';
27CREATE INDEX c1 ON t (c(1));
28SET DEBUG_SYNC='now WAIT_FOR created_t';
29UPDATE t SET c='ab';
30SELECT SLEEP(10);
31SLEEP(10)
320
33SET DEBUG_SYNC='now SIGNAL dml_done_u';
34SET DEBUG_SYNC='now SIGNAL dml_done_t';
35SET DEBUG_SYNC='RESET';
36DROP TABLE t,u;
37