File: rpl_row_idempotency.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (411 lines) | stat: -rw-r--r-- 14,292 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
include/master-slave.inc
Warnings:
Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
[connection master]
call mtr.add_suppression("Can.t find record in .t[12].* Error_code: MY-001032");
call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: MY-001451");
call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: MY-001452");
call mtr.add_suppression("Duplicate entry '1' for key 'ti1.PRIMARY'.* Error_code: MY-001062.*");
call mtr.add_suppression("The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
set @saved_slave_rows_search_algorithms= @@global.slave_rows_search_algorithms;
Warnings:
Warning	1287	'@@slave_rows_search_algorithms' is deprecated and will be removed in a future release.
SET GLOBAL slave_rows_search_algorithms= 'INDEX_SCAN,TABLE_SCAN';
Warnings:
Warning	1287	'@@slave_rows_search_algorithms' is deprecated and will be removed in a future release.
set @old_replica_exec_mode= @@global.replica_exec_mode;
set @@global.replica_exec_mode= IDEMPOTENT;
create table ti1 (b int primary key) engine = innodb;
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
include/sync_slave_sql_with_master.inc
select * from ti1 order by b /* must be (1),(2),(3) */;
b
1
2
3
insert into ti2 set a=1, b=1;
select * from ti2 order by b /* must be (1,1) (2,2) */;
a	b
1	1
2	2
set @save_binlog_format= @@session.binlog_format;
Warnings:
Warning	1287	'@@binlog_format' is deprecated and will be removed in a future release.
set @@session.binlog_format= 'row';
Warnings:
Warning	1287	'@@binlog_format' is deprecated and will be removed in a future release.
delete from ti1 where b=1;
select * from ti1 order by b /* must be (2),(3) */;
b
2
3
include/sync_slave_sql_with_master.inc
select * from ti1 order by b /* must stays as were on master (1),(2),(3) */;
b
1
2
3
delete from ti1 where b=3;
insert into ti2 set a=3, b=3;
include/sync_slave_sql_with_master.inc
select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */;
a	b
1	1
2	2
set global replica_exec_mode='IDEMPOTENT';
set global replica_exec_mode='STRICT';
set global replica_exec_mode='IDEMPOTENT,STRICT';
ERROR 42000: Variable 'replica_exec_mode' can't be set to the value of 'IDEMPOTENT,STRICT'
select @@global.replica_exec_mode /* must be STRICT */;
@@global.replica_exec_mode
STRICT
*** foreign keys errors as above now forces to stop
set foreign_key_checks=0;
drop table ti2, ti1;
create table ti1 (b int primary key) engine = innodb;
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
include/sync_slave_sql_with_master.inc
select * from ti1 order by b /* must be (1),(2),(3) */;
b
1
2
3
*** conspire future problem
insert into ti2 set a=1, b=1;
select * from ti2 order by b /* must be (1,1) (2,2) */;
a	b
1	1
2	2
delete from ti1 where b=1 /* offending delete event */;
select * from ti1 order by b /* must be (2),(3) */;
b
2
3
*** slave must stop (Trying to delete a referenced foreing key)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1451
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
b
1
2
3
set foreign_key_checks= 0;
delete from ti2 where b=1;
set foreign_key_checks= 1;
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
include/sync_slave_sql_with_master.inc
*** conspire the following insert failure
*** conspire future problem
delete from ti1 where b=3;
insert into ti2 set a=3, b=3 /* offending write event */;
*** slave must stop (Trying to insert an invalid foreign key)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1452
select * from ti2 order by b /* must be (2,2) */;
a	b
2	2
set foreign_key_checks= 0;
insert into ti1 set b=3;
set foreign_key_checks= 1;
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
include/sync_slave_sql_with_master.inc
select * from ti2 order by b /* must be (2,2),(3,3) */;
a	b
2	2
3	3
*** other errors
*** conspiring query
insert into ti1 set b=1;
insert into ti1 set b=1 /* offending write event */;
*** slave must stop (Trying to insert a dupliacte key)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1062
set foreign_key_checks= 0;
delete from ti1 where b=1;
set foreign_key_checks= 1;
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
INSERT INTO t2 VALUES (-1),(-2),(-3);
include/sync_slave_sql_with_master.inc
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
DELETE FROM t1 WHERE a = -2;
*** slave must stop (Key was not found)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
DELETE FROM t2 WHERE a = -2;
*** slave must stop (Key was not found)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
UPDATE t1 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
UPDATE t2 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
SET @@global.replica_exec_mode= @old_replica_exec_mode;
drop table t1,t2,ti2,ti1;
include/sync_slave_sql_with_master.inc
set @@global.replica_exec_mode= @old_replica_exec_mode;
include/rpl_reset.inc
SET GLOBAL slave_rows_search_algorithms= 'INDEX_SCAN,HASH_SCAN';
Warnings:
Warning	1287	'@@slave_rows_search_algorithms' is deprecated and will be removed in a future release.
set @old_replica_exec_mode= @@global.replica_exec_mode;
set @@global.replica_exec_mode= IDEMPOTENT;
create table ti1 (b int primary key) engine = innodb;
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
include/sync_slave_sql_with_master.inc
select * from ti1 order by b /* must be (1),(2),(3) */;
b
1
2
3
insert into ti2 set a=1, b=1;
select * from ti2 order by b /* must be (1,1) (2,2) */;
a	b
1	1
2	2
set @save_binlog_format= @@session.binlog_format;
Warnings:
Warning	1287	'@@binlog_format' is deprecated and will be removed in a future release.
set @@session.binlog_format= 'row';
Warnings:
Warning	1287	'@@binlog_format' is deprecated and will be removed in a future release.
delete from ti1 where b=1;
select * from ti1 order by b /* must be (2),(3) */;
b
2
3
include/sync_slave_sql_with_master.inc
select * from ti1 order by b /* must stays as were on master (1),(2),(3) */;
b
1
2
3
delete from ti1 where b=3;
insert into ti2 set a=3, b=3;
include/sync_slave_sql_with_master.inc
select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */;
a	b
1	1
2	2
set global replica_exec_mode='IDEMPOTENT';
set global replica_exec_mode='STRICT';
set global replica_exec_mode='IDEMPOTENT,STRICT';
ERROR 42000: Variable 'replica_exec_mode' can't be set to the value of 'IDEMPOTENT,STRICT'
select @@global.replica_exec_mode /* must be STRICT */;
@@global.replica_exec_mode
STRICT
*** foreign keys errors as above now forces to stop
set foreign_key_checks=0;
drop table ti2, ti1;
create table ti1 (b int primary key) engine = innodb;
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
include/sync_slave_sql_with_master.inc
select * from ti1 order by b /* must be (1),(2),(3) */;
b
1
2
3
*** conspire future problem
insert into ti2 set a=1, b=1;
select * from ti2 order by b /* must be (1,1) (2,2) */;
a	b
1	1
2	2
delete from ti1 where b=1 /* offending delete event */;
select * from ti1 order by b /* must be (2),(3) */;
b
2
3
*** slave must stop (Trying to delete a referenced foreing key)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1451
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
b
1
2
3
set foreign_key_checks= 0;
delete from ti2 where b=1;
set foreign_key_checks= 1;
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
include/sync_slave_sql_with_master.inc
*** conspire the following insert failure
*** conspire future problem
delete from ti1 where b=3;
insert into ti2 set a=3, b=3 /* offending write event */;
*** slave must stop (Trying to insert an invalid foreign key)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1452
select * from ti2 order by b /* must be (2,2) */;
a	b
2	2
set foreign_key_checks= 0;
insert into ti1 set b=3;
set foreign_key_checks= 1;
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
include/sync_slave_sql_with_master.inc
select * from ti2 order by b /* must be (2,2),(3,3) */;
a	b
2	2
3	3
*** other errors
*** conspiring query
insert into ti1 set b=1;
insert into ti1 set b=1 /* offending write event */;
*** slave must stop (Trying to insert a dupliacte key)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1062
set foreign_key_checks= 0;
delete from ti1 where b=1;
set foreign_key_checks= 1;
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
INSERT INTO t2 VALUES (-1),(-2),(-3);
include/sync_slave_sql_with_master.inc
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
DELETE FROM t1 WHERE a = -2;
*** slave must stop (Key was not found)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
DELETE FROM t2 WHERE a = -2;
*** slave must stop (Key was not found)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
UPDATE t1 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
set global replica_exec_mode='STRICT';
UPDATE t2 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global replica_exec_mode='IDEMPOTENT';
start slave sql_thread;
Warnings:
Warning	1287	'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
include/sync_slave_sql_with_master.inc
SET @@global.replica_exec_mode= @old_replica_exec_mode;
drop table t1,t2,ti2,ti1;
include/sync_slave_sql_with_master.inc
set @@global.replica_exec_mode= @old_replica_exec_mode;
set @@global.slave_rows_search_algorithms= @saved_slave_rows_search_algorithms;
Warnings:
Warning	1287	'@@slave_rows_search_algorithms' is deprecated and will be removed in a future release.
*** end of tests
include/rpl_end.inc