Debian Codegraph @

mysql-test/suite/rpl_gtid/r/rpl_gtids_table.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 SET @debug_save= @@GLOBAL.DEBUG;
7 call mtr.add_suppression("test the suppression statement");
8 SHOW CREATE TABLE mysql.gtid_executed;
9 Table Create Table
10 gtid_executed CREATE TABLE `gtid_executed` (
11 `source_uuid` char(36) NOT NULL COMMENT 'uuid of the source where the transaction was originally executed.',
12 `interval_start` bigint NOT NULL COMMENT 'First number of interval.',
13 `interval_end` bigint NOT NULL COMMENT 'Last number of interval.',
14 PRIMARY KEY (`source_uuid`,`interval_start`)
15 ) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
16 #
17 # Verify that the specified gtid to GTID_NEXT can be reported from
18 # global.gtid_executed and is stored into gtid_executed table on
19 # following binlog rotation.
20 #
21 SET GTID_NEXT='MASTER_UUID:3';
22 BEGIN;
23 COMMIT;
24 include/assert.inc [committed gtids MASTER_UUID:1:3]
25 SET GTID_NEXT='AUTOMATIC';
26 FLUSH LOGS;
27 #
28 # Store gtids MASTER_UUID:1:3 in gtid_executed table on binlog rotation
29 #
30 SELECT * FROM mysql.gtid_executed;
31 source_uuid interval_start interval_end
32 MASTER_UUID 1 1
33 MASTER_UUID 3 3
34 #
35 # Verify that these gtids can be reported from global.gtid_executed and
36 # are stored into gtid_executed table on next rotation for normal DDLs.
37 #
38 CREATE TABLE IF NOT EXISTS t1 (a INT) ENGINE=InnoDB;
39 CREATE TABLE t2 (a INT) ENGINE=MyISAM;
40 include/assert.inc [committed gtids MASTER_UUID:1-4]
41 #
42 # Store gtids MASTER_UUID:1-4 in gtid_executed table on binlog rotation
43 #
44 SET @@GLOBAL.DEBUG= '+d,compress_gtid_table';
45 FLUSH LOGS;
46 SET DEBUG_SYNC='now WAIT_FOR complete_compression';
47 SELECT * FROM mysql.gtid_executed;
48 source_uuid interval_start interval_end
49 MASTER_UUID 1 4
50 #
51 # Verify that these gtids can be reported from global.gtid_executed
52 # and are stored into gtid_executed table for compound statement with
53 # regular and temporary tables.
54 #
55 CREATE TEMPORARY TABLE tmp1 (c1 INT) Engine=MyISAM;
56 CREATE TABLE t3 (a INT);
57 DROP TEMPORARY TABLE tmp1, t3;
58 ERROR 42S02: Unknown table 'test.t3'
59 DROP TEMPORARY TABLE tmp1;
60 DROP TABLE t3;
61 include/assert.inc [committed gtids MASTER_UUID:1-8]
62 #
63 # Store gtids MASTER_UUID:1-8 in gtid_executed table on binlog rotation
64 #
65 SET @@GLOBAL.DEBUG= '+d,compress_gtid_table';
66 FLUSH LOGS;
67 SET DEBUG_SYNC='now WAIT_FOR complete_compression';
68 SELECT * FROM mysql.gtid_executed;
69 source_uuid interval_start interval_end
70 MASTER_UUID 1 8
71 #
72 # Verify that transactions' gtids can be reported from
73 # global.gtid_executed correctly and are stored into
74 # gtid_executed table on next binlog rotation.
75 #
76 BEGIN;
77 INSERT INTO t2 VALUES(2);
78 INSERT INTO t1 VALUES(1);
79 INSERT INTO t1 VALUES(2);
80 COMMIT;
81 #
82 # Verify that specified gtid for transaction can be reported from
83 # global.gtid_executed correctly and is stored into gtid_executed
84 # table on next binlog rotation.
85 #
86 SET @@SESSION.GTID_NEXT= 'MASTER_UUID:11';
87 BEGIN;
88 INSERT INTO t1 VALUES(3);
89 COMMIT;
90 include/assert.inc [committed gtids MASTER_UUID:1-11]
91 SET GTID_NEXT='AUTOMATIC';
92 SET @@GLOBAL.DEBUG= '+d,compress_gtid_table';
93 FLUSH LOGS;
94 SET DEBUG_SYNC='now WAIT_FOR complete_compression';
95 #
96 # Store gtids MASTER_UUID:1-11 in gtid_executed table on binlog rotation
97 #
98 SELECT * FROM mysql.gtid_executed;
99 source_uuid interval_start interval_end
100 MASTER_UUID 1 11
101 #
102 # Verify that transaction's gtid can not be reported from
103 # global.gtid_executed and is not stored into gtid_executed table
104 # on next binlog rotation if the transaction is rollbacked.
105 #
106 BEGIN;
107 INSERT INTO t1 VALUES(4);
108 ROLLBACK;
109 include/assert.inc [committed gtids MASTER_UUID:1-11]
110 #
111 # Store gtids MASTER_UUID:1-11 in gtid_executed table on binlog rotation
112 #
113 FLUSH LOGS;
114 SELECT * FROM mysql.gtid_executed;
115 source_uuid interval_start interval_end
116 MASTER_UUID 1 11
117 SET GLOBAL DEBUG= @debug_save;
118 include/sync_slave_sql_with_master.inc
119 #
120 # connection slave
121 #
122 #
123 # Verify that the transaction is skiped if its specified gtid is
124 # already in global.gtid_executed, although not in gtid_executed table.
125 #
126 SET @@SESSION.GTID_NEXT= 'MASTER_UUID:6';
127 INSERT INTO t1 VALUES(11);
128 include/assert.inc [Table t1 must not contain 11]
129 include/assert.inc [committed gtids MASTER_UUID:1-11]
130 #
131 # The gtid_executed table would only have GTID for Innodb transactions
132 #
133 #
134 # Store gtids MASTER_UUID:1-11 in gtid_executed table on binlog rotation
135 #
136 SET GTID_NEXT='AUTOMATIC';
137 FLUSH LOGS;
138 SELECT * FROM mysql.gtid_executed;
139 source_uuid interval_start interval_end
140 MASTER_UUID 1 11
141 #
142 # Verify that the specified gtid to GTID_NEXT is stored into
143 # global.gtid_executed immediately and stored into gtid_executed table
144 # on next binlog rotation.
145 #
146 SET @@SESSION.GTID_NEXT= 'MASTER_UUID:17';
147 COMMIT;
148 include/assert.inc [committed gtids MASTER_UUID:1-11:17]
149 #
150 # Store gtids MASTER_UUID:1-11:17 in gtid_executed table
151 # on next binlog rotation.
152 #
153 SET GTID_NEXT='AUTOMATIC';
154 FLUSH LOGS;
155 SELECT * FROM mysql.gtid_executed;
156 source_uuid interval_start interval_end
157 MASTER_UUID 1 11
158 MASTER_UUID 17 17
159 #
160 # Verify that we can get the correct set of gtid_purged
161 # when purging logs.
162 #
163 PURGE BINARY LOGS TO 'slave-bin.000003';
164 include/assert.inc [purged gtids MASTER_UUID:1-11:17]
165 #
166 # Verify that transaction's gtid generated on slave is stored
167 # into gtid_executed table on next binlog rotation.
168 #
169 BEGIN;
170 INSERT INTO t1 VALUES(12);
171 COMMIT;
172 #
173 # Store gtids MASTER_UUID:1-11:17 and SLAVE_UUID:1
174 # in gtid_executed table on binlog rotation.
175 #
176 FLUSH LOGS;
177 SELECT * FROM mysql.gtid_executed where source_uuid="MASTER_UUID";
178 source_uuid interval_start interval_end
179 MASTER_UUID 1 11
180 MASTER_UUID 17 17
181 SELECT * FROM mysql.gtid_executed where source_uuid="SLAVE_UUID";
182 source_uuid interval_start interval_end
183 SLAVE_UUID 1 1
184 DROP TABLE t1, t2;
185 include/rpl_end.inc