Debian Codegraph @

mysql-test/suite/innodb_fts/t/concurrent_insert.test

raw
1 --source include/have_innodb.inc
2 --source include/have_debug.inc
3 --source include/have_debug_sync.inc
4
5 CREATE TABLE t1(a VARCHAR(5),FULLTEXT KEY(a)) ENGINE=InnoDB;
6 SET DEBUG_SYNC = 'get_next_FTS_DOC_ID SIGNAL prepared WAIT_FOR race';
7 --send
8 REPLACE INTO t1(a) values('aaa');
9
10 connect(dml, localhost, root, ,);
11 SET DEBUG_SYNC = 'now WAIT_FOR prepared';
12 REPLACE INTO t1(a) VALUES('aaa');
13 SET DEBUG_SYNC = 'now SIGNAL race';
14 disconnect dml;
15
16 connection default;
17 reap;
18 SET DEBUG_SYNC = 'RESET';
19
20 DROP TABLE t1;
21
22 --echo #
23 --echo # MDEV-19529 InnoDB hang on DROP FULLTEXT INDEX
24 --echo #
25
26 CREATE TABLE t1(f1 CHAR(100), FULLTEXT(f1))ENGINE=InnoDB;
27 INSERT INTO t1 VALUES('test');
28 CREATE TABLE t2 (f1 char(100), FULLTEXT idx1(f1))ENGINE=InnoDB;
29 INSERT INTO t2 VALUES('mariadb');
30
31 connection default;
32 SET @saved_dbug = @@GLOBAL.debug_dbug;
33 SET GLOBAL debug_dbug ='+d,fts_instrument_sync_request,ib_optimize_wq_hang';
34 SET DEBUG_SYNC= 'fts_instrument_sync_request
35 SIGNAL drop_index_start WAIT_FOR sync_op';
36 send INSERT INTO t1 VALUES('Keyword');
37
38 connect(con1,localhost,root,,,);
39 SET DEBUG_SYNC='now WAIT_FOR drop_index_start';
40 SET DEBUG_SYNC= 'norebuild_fts_drop SIGNAL sync_op WAIT_FOR fts_drop_index';
41 send ALTER TABLE t2 drop index idx1;
42
43 connection default;
44 reap;
45 set DEBUG_SYNC= 'now SIGNAL fts_drop_index';
46
47 connection con1;
48 reap;
49 drop table t1, t2;
50 connection default;
51 SET @@GLOBAL.debug_dbug = @saved_dbug;
52 disconnect con1;
53
54 --echo #
55 --echo # MDEV-25984 Assertion `max_doc_id > 0' failed in fts_init_doc_id()
56 --echo #
57 call mtr.add_suppression("InnoDB: \\(Lock wait timeout\\) while getting next doc id for table `test`.`t1`");
58
59 CREATE TABLE t1(f1 CHAR(100), f2 INT, fulltext(f1))ENGINE=InnoDB;
60 INSERT INTO t1 VALUES("mariadb", 1), ("innodb", 1);
61 --source include/restart_mysqld.inc
62 SET DEBUG_SYNC='innodb_rollback_after_fts_lock SIGNAL insert_dml WAIT_FOR ddl_continue';
63 SEND ALTER TABLE t1 ADD UNIQUE INDEX(f2);
64
65 connect(con1,localhost,root,,,);
66 SET DEBUG_SYNC='now WAIT_FOR insert_dml';
67 SET DEBUG_SYNC='fts_cmp_set_sync_doc_id_retry SIGNAL ddl_continue WAIT_FOR dml_finish';
68 send INSERT INTO t1 VALUES("index", 2);
69
70 connection default;
71 --error ER_DUP_ENTRY
72 reap;
73 SET DEBUG_SYNC="now SIGNAL dml_finish";
74 connection con1;
75 reap;
76 SHOW CREATE TABLE t1;
77 connection default;
78 disconnect con1;
79 DROP TABLE t1;
80 set DEBUG_SYNC=RESET;