Debian Codegraph @

mysql-test/suite/binlog_gtid/t/binlog_gtid_compress_at_server_start.test

raw
1 # ==== Purpose ====
2 #
3 # This test evaluates that we invoke the method that compresses the
4 # mysql.gtid_executed table when the server starts.
5 #
6 # ==== Implementation ====
7 #
8 # 0. This test requires only one server
9 # 1. Create a table with 2 values.
10 # Wait that each transaction appears individually in the table
11 # 2. Assert the table is not compressed
12 # 3. Restart the server
13 # Assert the table is compressed
14 # 4. Cleanup
15 #
16 # ==== References ====
17 #
18 # Bug#30541799 MYSQL.GTID_EXECUTED TABLE NOT COMPRESSED ON STARTUP FROM 8.0.17
19
20 # Test in this file is binlog format agnostic
21 --source include/have_binlog_format_row.inc
22
23 --let $server_uuid= `SELECT @@GLOBAL.SERVER_UUID`
24
25 #Clean the table before starting the test.
26 RESET MASTER;
27
28 --echo #
29 --echo # 1. Create a table with 2 values.
30 --echo # Wait that each transaction appears individually in the table
31
32 CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=INNODB;
33
34 let $wait_condition = SELECT count(*) = 1 FROM mysql.gtid_executed
35 WHERE interval_start = 1 AND interval_end = 1;
36 --source include/wait_condition.inc
37
38 INSERT INTO t1 VALUES (1);
39
40 let $wait_condition = SELECT count(*) = 1 FROM mysql.gtid_executed
41 WHERE interval_start = 2 AND interval_end = 2;
42 --source include/wait_condition.inc
43
44 INSERT INTO t1 VALUES (2);
45
46 let $wait_condition = SELECT count(*) = 1 FROM mysql.gtid_executed
47 WHERE interval_start = 3 AND interval_end = 3;
48 --source include/wait_condition.inc
49
50 --echo #
51 --echo # 2. Assert the table is not compressed
52
53 --let $assert_text= COMMITTED_GTIDS SERVER_UUID:1-3
54 --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$server_uuid:1-3"
55 --source include/assert.inc
56
57 --let $assert_cond= COUNT(*) = 3 FROM mysql.gtid_executed
58 --let $assert_text= The mysql gtid table should have 3 rows
59 --source include/assert.inc
60
61 --echo #
62 --echo # 3. Restart the server
63 --echo # Assert the table is compressed
64
65 --source include/restart_mysqld.inc
66
67 let $wait_condition = SELECT count(*) = 1 FROM mysql.gtid_executed
68 WHERE interval_start = 1 AND interval_end = 3;
69 --source include/wait_condition.inc
70
71 --let $assert_cond= COUNT(*) = 1 FROM mysql.gtid_executed
72 --let $assert_text= The mysql gtid table should have 1 row
73 --source include/assert.inc
74
75 --echo #
76 --echo # 4. Cleanup
77
78 DROP TABLE t1;