Debian Codegraph @

mysql-test/suite/rpl/r/rpl_xa.result

raw
1 include/master-slave.inc
2 [connection master]
3 connection master;
4 create table t1 (a int, b int) engine=InnoDB;
5 insert into t1 values(0, 0);
6 xa start 't';
7 insert into t1 values(1, 2);
8 xa end 't';
9 xa prepare 't';
10 xa commit 't';
11 connection slave;
12 include/diff_tables.inc [master:t1, slave:t1]
13 connection master;
14 xa start 't';
15 insert into t1 values(3, 4);
16 xa end 't';
17 xa prepare 't';
18 xa rollback 't';
19 connection slave;
20 include/diff_tables.inc [master:t1, slave:t1]
21 connection master;
22 SET pseudo_slave_mode=1;
23 create table t2 (a int) engine=InnoDB;
24 xa start 't';
25 insert into t1 values (5, 6);
26 xa end 't';
27 xa prepare 't';
28 xa start 's';
29 insert into t2 values (0);
30 xa end 's';
31 xa prepare 's';
32 Warnings:
33 Warning 4205 Pseudo thread id should not be modified by the client as it will be overwritten
34 include/save_master_gtid.inc
35 connection slave;
36 include/sync_with_master_gtid.inc
37 xa recover;
38 formatID gtrid_length bqual_length data
39 1 1 0 s
40 1 1 0 t
41 connection master;
42 xa commit 't';
43 xa commit 's';
44 SET pseudo_slave_mode=0;
45 connection slave;
46 include/diff_tables.inc [master:t1, slave:t1]
47 include/diff_tables.inc [master:t2, slave:t2]
48 connection master;
49 *** At the start of read-only section gtid list is:
50 flush logs;
51 show binlog events in 'master-bin.000002' limit 1,1;
52 Log_name Pos Event_type Server_id End_log_pos Info
53 master-bin.000002 # Gtid_list 1 # [0-1-11]
54 set @query1="select 1";
55 set @query2="select count(*) into @s2 from t1";
56 connection master;
57 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
58 xa start 'ro_2';
59 select count(*) into @s2 from t1;
60 xa end 'ro_2';
61 xa prepare 'ro_2';;
62 disconnect master_ro_2;
63 connection master;
64 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
65 xa start 'ro_1';
66 select 1;
67 1
68 1
69 xa end 'ro_1';
70 xa prepare 'ro_1';;
71 disconnect master_ro_1;
72 connection master;
73 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
74 xa start 'ro_2';
75 select count(*) into @s2 from t1;
76 xa end 'ro_2';
77 xa prepare 'ro_2';;
78 disconnect master_ro_2;
79 connection master;
80 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
81 xa start 'ro_1';
82 select 1;
83 1
84 1
85 xa end 'ro_1';
86 xa prepare 'ro_1';;
87 disconnect master_ro_1;
88 *** 2 prepared xa:s must be in the list:
89 connection master;
90 xa recover;
91 formatID gtrid_length bqual_length data
92 1 4 0 ro_1
93 1 4 0 ro_2
94 *** Zero prepared xa:s must be in the list:
95 xa recover;
96 formatID gtrid_length bqual_length data
97 *** At the end of read-only section gtid list has 0 more compare with previous check:
98 flush logs;
99 show binlog events in 'master-bin.000003' limit 1,1;
100 Log_name Pos Event_type Server_id End_log_pos Info
101 master-bin.000003 # Gtid_list 1 # [0-1-11]
102 create database test_ign;
103 set @@sql_log_bin = 0;
104 create table test_ign.t (a int) engine=InnoDB;
105 set @@sql_log_bin = 1;
106 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
107 xa start 'rw_no_binlog';
108 insert into test_ign.t set a=1;
109 xa end 'rw_no_binlog';
110 xa prepare 'rw_no_binlog';;
111 disconnect master_rw_no_binlog;
112 *** rw_no_binlog must be in the list:
113 connection master;
114 xa recover;
115 formatID gtrid_length bqual_length data
116 1 12 0 rw_no_binlog
117 *** Zero must be in the list:
118 connection master;
119 xa recover;
120 formatID gtrid_length bqual_length data
121 *** At the end of --binlog-ignore-db section gtid list has 2 more:
122 flush logs;
123 show binlog events in 'master-bin.000004' limit 1,1;
124 Log_name Pos Event_type Server_id End_log_pos Info
125 master-bin.000004 # Gtid_list 1 # [0-1-13]
126 connection master;
127 create table t3 (a int) engine=innodb;
128 *** the disconnected prepare case
129 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
130 set @@binlog_format=statement;
131 xa start 'rw_binlog_only';
132 delete from t3;
133 xa end 'rw_binlog_only';
134 xa prepare 'rw_binlog_only';
135 disconnect master_rw_binlog_only;
136 connection master;
137 *** rw_binlog_only must be in the list:
138 xa recover;
139 formatID gtrid_length bqual_length data
140 1 14 0 rw_binlog_only
141 *** Zero must be in the list:
142 xa recover;
143 formatID gtrid_length bqual_length data
144 *** the same connection complete case.
145 connection master;
146 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
147 set @@binlog_format=statement;
148 xa start 'rw_binlog_only';
149 delete from t3;
150 xa end 'rw_binlog_only';
151 xa prepare 'rw_binlog_only';
152 *** rw_binlog_only must be in the list:
153 xa recover;
154 formatID gtrid_length bqual_length data
155 1 14 0 rw_binlog_only
156 disconnect master_rw_binlog_only;
157 *** Zero must be in the list:
158 connection master;
159 xa recover;
160 formatID gtrid_length bqual_length data
161 *** At the end of ineffective in engine section gtid list has 5 more:
162 flush logs;
163 show binlog events in 'master-bin.000005' limit 1,1;
164 Log_name Pos Event_type Server_id End_log_pos Info
165 master-bin.000005 # Gtid_list 1 # [0-1-18]
166 create table tm (a int) engine=myisam;
167 connection master;
168 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
169 xa start 'rw_myisam';
170 insert into tm set a=1;
171 xa end 'rw_myisam';
172 xa prepare 'rw_myisam';;
173 disconnect master_rw_myisam;
174 connection master;
175 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
176 xa start 'rw_myisam';
177 insert into tm set a=1;
178 xa end 'rw_myisam';
179 xa prepare 'rw_myisam';;
180 disconnect master_rw_myisam;
181 *** rw_myisam prepared must be in the list:
182 connection master;
183 xa recover;
184 formatID gtrid_length bqual_length data
185 1 9 0 rw_myisam
186 *** Zero prepared xa:s must be in the list:
187 xa recover;
188 formatID gtrid_length bqual_length data
189 *** At the end of MyISAM "xa" section gtid list has 7 more compare with previous check:
190 flush logs;
191 show binlog events in 'master-bin.000006' limit 1,1;
192 Log_name Pos Event_type Server_id End_log_pos Info
193 master-bin.000006 # Gtid_list 1 # [0-1-25]
194 connect master_$xid, 127.0.0.1,root,,$db,$MASTER_MYPORT,;
195 set @@session.sql_log_bin = OFF;
196 xa start 'skip_binlog';
197 insert into t2 values(1);
198 xa end 'skip_binlog';
199 xa prepare 'skip_binlog';
200 disconnect master_skip_binlog;
201 *** skip_binlog must be in the list:
202 connection master;
203 xa recover;
204 formatID gtrid_length bqual_length data
205 1 11 0 skip_binlog
206 set @@session.sql_log_bin = OFF;
207 xa rollback 'skip_binlog';
208 set @@session.sql_log_bin = ON;
209 include/save_master_gtid.inc
210 *** Zero must be in the list:
211 connection master;
212 xa recover;
213 formatID gtrid_length bqual_length data
214 *** At the end of skip_log_binb section gtid list has 0 more:
215 flush logs;
216 show binlog events in 'master-bin.000007' limit 1,1;
217 Log_name Pos Event_type Server_id End_log_pos Info
218 master-bin.000007 # Gtid_list 1 # [0-1-25]
219 connection slave;
220 include/sync_with_master_gtid.inc
221 connection master;
222 drop database test_ign;
223 drop table t1, t2, t3, tm;
224 #
225 # MDEV-26682 slave lock timeout with XA and gap locks
226 #
227 create table t1 (a int primary key, b int unique) engine=innodb;
228 insert t1 values (1,1),(3,3),(5,5);
229 connection slave;
230 set session transaction_isolation='repeatable-read';
231 start transaction;
232 select * from t1;
233 a b
234 1 1
235 3 3
236 5 5
237 connect m2, localhost, root;
238 delete from t1 where a=3;
239 xa start 'x1';
240 update t1 set b=3 where a=5;
241 xa end 'x1';
242 xa prepare 'x1';
243 connect m3, localhost, root;
244 insert t1 values (2, 2);
245 -->slave
246 connection slave;
247 commit;
248 select * from t1;
249 a b
250 1 1
251 2 2
252 5 5
253 connection m2;
254 xa rollback 'x1';
255 disconnect m2;
256 disconnect m3;
257 connection master;
258 drop table t1;
259 create table t1 (id int auto_increment primary key, c1 int not null unique)
260 engine=innodb;
261 create table t2 (id int auto_increment primary key, c1 int not null,
262 foreign key(c1) references t1(c1), unique key(c1)) engine=innodb;
263 insert t1 values (869,1), (871,3), (873,4), (872,5), (870,6), (877,7);
264 insert t2 values (795,6), (800,7);
265 xa start '1';
266 update t2 set id = 9, c1 = 5 where c1 in (null, null, null, null, null, 7, 3);
267 connect con1, localhost,root;
268 xa start '2';
269 delete from t1 where c1 like '3%';
270 xa end '2';
271 xa prepare '2';
272 connection master;
273 xa end '1';
274 xa prepare '1';
275 ->slave
276 connection slave;
277 connection slave;
278 include/sync_with_master_gtid.inc
279 connection con1;
280 xa commit '2';
281 disconnect con1;
282 connection master;
283 xa commit '1';
284 drop table t2, t1;
285 include/rpl_end.inc