Debian Codegraph @

mysql-test/suite/innodb_fts/r/sync_block.result

raw
1 SET @old_log_output = @@global.log_output;
2 SET @old_slow_query_log = @@global.slow_query_log;
3 SET @old_general_log = @@global.general_log;
4 SET @old_long_query_time = @@global.long_query_time;
5 SET @old_debug = @@global.debug_dbug;
6 SET GLOBAL log_output = 'TABLE';
7 SET GLOBAL general_log = 1;
8 SET GLOBAL slow_query_log = 1;
9 SET GLOBAL long_query_time = 1;
10 connect con1,localhost,root,,;
11 connect con2,localhost,root,,;
12 connection default;
13 # Case 1: Sync blocks DML(insert) on the same table.
14 CREATE TABLE t1 (
15 FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
16 title VARCHAR(200),
17 FULLTEXT(title)
18 ) ENGINE = InnoDB;
19 connection con1;
20 SET GLOBAL debug_dbug='+d,fts_instrument_sync_debug,fts_instrument_sync_sleep';
21 SET DEBUG_SYNC= 'fts_sync_begin SIGNAL begin WAIT_FOR continue';
22 INSERT INTO t1(title) VALUES('mysql database');
23 connection con2;
24 SET DEBUG_SYNC= 'now WAIT_FOR begin';
25 SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
26 connection default;
27 SET DEBUG_SYNC= 'now SIGNAL continue';
28 connection con1;
29 /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
30 connection con2;
31 /* conneciton con2 */ SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
32 FTS_DOC_ID title
33 connection default;
34 # make con1 & con2 show up in mysql.slow_log
35 SELECT SLEEP(2);
36 SLEEP(2)
37 0
38 # slow log results should only contain INSERT INTO t1.
39 SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
40 sql_text
41 INSERT INTO t1(title) VALUES('mysql database')
42 SET GLOBAL debug_dbug = @old_debug;
43 TRUNCATE TABLE mysql.slow_log;
44 DROP TABLE t1;
45 # Case 2: Sync blocks DML(insert) on other tables.
46 CREATE TABLE t1 (
47 FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
48 title VARCHAR(200),
49 FULLTEXT(title)
50 ) ENGINE = InnoDB;
51 CREATE TABLE t2(id INT);
52 connection con1;
53 SET GLOBAL debug_dbug='+d,fts_instrument_sync_request,fts_instrument_sync_sleep';
54 SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL begin WAIT_FOR continue';
55 INSERT INTO t1(title) VALUES('mysql database');
56 connection con2;
57 SET DEBUG_SYNC= 'now WAIT_FOR begin';
58 INSERT INTO t2 VALUES(1);
59 connection default;
60 SET DEBUG_SYNC= 'now SIGNAL continue';
61 connection con1;
62 /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
63 connection con2;
64 /* conneciton con2 */ INSERT INTO t2 VALUES(1);
65 connection default;
66 SET DEBUG_SYNC = 'RESET';
67 # make con1 & con2 show up in mysql.slow_log
68 SELECT SLEEP(2);
69 SLEEP(2)
70 0
71 # slow log results should be empty here.
72 SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
73 sql_text
74 SET GLOBAL debug_dbug = @old_debug;
75 TRUNCATE TABLE mysql.slow_log;
76 DROP TABLE t1,t2;
77 disconnect con1;
78 disconnect con2;
79 # Restore slow log settings.
80 SET GLOBAL log_output = @old_log_output;
81 SET GLOBAL general_log = @old_general_log;
82 SET GLOBAL slow_query_log = @old_slow_query_log;
83 SET GLOBAL long_query_time = @old_long_query_time;