2 # Basic tests of row-level logging
6 # First we test tables with only an index.
9 eval CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)$extra_index_t1) ENGINE = $type ;
11 sync_slave_with_master;
16 INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X');
17 INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A');
18 SELECT * FROM t1 ORDER BY C1,C2;
19 sync_slave_with_master;
20 SELECT * FROM t1 ORDER BY C1,C2;
23 # Observe that are several rows having the value for the index but only one
26 DELETE FROM t1 WHERE C1 = C2;
27 SELECT * FROM t1 ORDER BY C1,C2;
28 sync_slave_with_master;
29 SELECT * FROM t1 ORDER BY C1,C2;
33 # Note that we have a condition on a column that is not part of the index for
34 # the table. The right row should be updated nevertheless.
37 UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
38 SELECT * FROM t1 ORDER BY C1,C2;
39 sync_slave_with_master;
40 SELECT * FROM t1 ORDER BY C1,C2;
42 # Testing update with a condition that does not match any rows, but
43 # which has a match for the index.
45 UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
46 SELECT * FROM t1 ORDER BY c1,c2;
47 sync_slave_with_master;
48 SELECT * FROM t1 ORDER BY c1,c2;
51 # Testing table with primary key
54 eval CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = $type ;
56 VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25),
57 (6,'A',35), (7,'A',50), (8,'A',64), (9,'A',81);
58 SELECT * FROM t2 ORDER BY c1,c2;
59 SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
60 sync_slave_with_master;
61 SELECT * FROM t2 ORDER BY c1,c2;
62 SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
65 UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
66 SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
67 sync_slave_with_master;
68 SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
70 # Testing update with a condition that does not match any rows, but
71 # which has a match for the primary key.
73 UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
74 SELECT * FROM t2 ORDER BY c1,c2;
75 sync_slave_with_master;
76 SELECT * FROM t2 ORDER BY c1,c2;
79 DELETE FROM t2 WHERE c1 % 4 = 0;
80 SELECT * FROM t2 ORDER BY c1,c2;
81 sync_slave_with_master;
82 SELECT * FROM t2 ORDER BY c1,c2;
85 UPDATE t2 SET c12='X';
88 # Testing table with a multi-column primary key.
91 eval CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = $type ;
93 INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1);
94 INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2);
95 SELECT * FROM t3 ORDER BY C1,C2;
96 sync_slave_with_master;
97 SELECT * FROM t3 ORDER BY C1,C2;
100 DELETE FROM t3 WHERE C1 = C2;
101 SELECT * FROM t3 ORDER BY C1,C2;
102 sync_slave_with_master;
103 SELECT * FROM t3 ORDER BY C1,C2;
106 UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
107 SELECT * FROM t3 ORDER BY C1,C2;
108 sync_slave_with_master;
109 SELECT * FROM t3 ORDER BY C1,C2;
112 # Testing table without index or primary key
115 eval CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT$extra_index_t6) ENGINE = $type;
118 INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
119 INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
120 SELECT * FROM t6 ORDER BY C3;
121 sync_slave_with_master;
122 SELECT * FROM t6 ORDER BY C3;
125 # Observe that are several rows having the value for the index but only one
128 DELETE FROM t6 WHERE C1 = C2;
129 SELECT * FROM t6 ORDER BY C3;
130 sync_slave_with_master;
131 SELECT * FROM t6 ORDER BY C3;
135 # Note that we have a condition on a column that is not part of the index for
136 # the table. The right row should be updated nevertheless.
139 UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
140 SELECT * FROM t6 ORDER BY C3;
141 sync_slave_with_master;
142 SELECT * FROM t6 ORDER BY C3;
144 # now mixing the 3 tables without begin/commit
146 eval CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = $type ;
147 INSERT INTO t5 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
148 INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
150 UPDATE t5,t2,t3 SET t5.C2='Q', t2.c12='R', t3.C3 ='S' WHERE t5.C1 = t2.c12 AND t5.C1 = t3.C1;
151 SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
152 sync_slave_with_master;
153 SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
156 # Testing special column types
160 eval CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = $type ;
162 INSERT INTO t4 SET C1 = 1;
163 SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
164 sync_slave_with_master;
165 SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
168 # Testing conflicting operations
171 eval CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = $type ;
172 sync_slave_with_master;
173 --echo --- on slave: original values ---
174 INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
175 SELECT * FROM t7 ORDER BY C1;
177 # since bug#31552/31609 idempotency is not default any longer. In order
178 # the preceeding test INSERT INTO t7 to pass the mode is switched
180 set @@global.slave_exec_mode= 'IDEMPOTENT';
183 --echo --- on master: new values inserted ---
184 INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
185 SELECT * FROM t7 ORDER BY C1;
186 sync_slave_with_master;
188 set @@global.slave_exec_mode= default;
189 --echo --- on slave: old values should be overwritten by replicated values ---
190 SELECT * FROM t7 ORDER BY C1;
193 # A more complicated test where the table has several keys and we are
194 # causing a conflict for a key that is not "last".
197 --echo --- on master ---
198 eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $type ;
200 # First we make sure that the constraints are correctly set.
201 INSERT INTO t8 VALUES (99,99,99);
203 INSERT INTO t8 VALUES (99,22,33);
205 INSERT INTO t8 VALUES (11,99,33);
207 INSERT INTO t8 VALUES (11,22,99);
208 SELECT * FROM t8 ORDER BY a;
210 sync_slave_with_master;
211 --echo --- on slave ---
212 SELECT * FROM t8 ORDER BY a;
213 INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
214 SELECT * FROM t8 ORDER BY a;
216 # since bug#31552/31609 idempotency is not default any longer. In order
217 # the preceeding test INSERT INTO t8 to pass the mode is switched
219 set @@global.slave_exec_mode= 'IDEMPOTENT';
222 --echo --- on master ---
223 # We insert a row that will cause conflict on the primary key but not
225 INSERT INTO t8 VALUES (2,4,8);
226 sync_slave_with_master;
227 set @@global.slave_exec_mode= default;
229 --echo --- on slave ---
230 SELECT * FROM t8 ORDER BY a;
232 # BUG#31552: Replication breaks when deleting rows from out-of-sync
235 --echo **** Test for BUG#31552 ****
237 --echo **** On Master ****
238 # Clean up t1 so that we can use it.
241 sync_slave_with_master;
243 # Just to get a clean binary log
244 --source include/rpl_reset.inc
246 --echo **** On Master ****
248 INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
249 --echo **** On Master ****
250 sync_slave_with_master;
251 # since bug#31552/31609 idempotency is not default any longer. In order
252 # the following test DELETE FROM t1 to pass the mode is switched
254 set @@global.slave_exec_mode= 'IDEMPOTENT';
255 DELETE FROM t1 WHERE C1 = 'L';
259 query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
260 sync_slave_with_master;
261 set @@global.slave_exec_mode= default;
262 source include/check_slave_is_running.inc;
263 query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
265 # BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly
266 # between machines with mixed endiannes
269 --echo **** Test for BUG#37076 ****
270 --echo **** On Master ****
272 DROP TABLE IF EXISTS t1;
273 CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
274 INSERT INTO t1 VALUES(
275 '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
277 --echo **** On Slave ****
278 sync_slave_with_master slave;
286 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
287 sync_slave_with_master;
290 # BUG#37426: RBR breaks for CHAR() UTF8 fields > 85 chars
293 # We have 4 combinations to test with respect to the field length
294 # (i.e., the number of bytes) of the CHAR fields:
296 # 1. Replicating from CHAR<256 to CHAR<256
297 # 2. Replicating from CHAR<256 to CHAR>255
298 # 3. Replicating from CHAR>255 to CHAR<256
299 # 4. Replicating from CHAR>255 to CHAR>255
301 # We also make a special case of using the max size of a field on the
302 # master, i.e. CHAR(255) in UTF-8, giving another three cases.
304 # 5. Replicating UTF-8 CHAR(255) to CHAR(<256)
305 # 6. Replicating UTF-8 CHAR(255) to CHAR(>255)
306 # 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8
309 eval CREATE TABLE t1 (i INT NOT NULL,
310 c CHAR(16) CHARACTER SET utf8 NOT NULL,
311 j INT NOT NULL) ENGINE = $type ;
313 eval CREATE TABLE t2 (i INT NOT NULL,
314 c CHAR(16) CHARACTER SET utf8 NOT NULL,
315 j INT NOT NULL) ENGINE = $type ;
317 sync_slave_with_master;
318 ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
321 eval CREATE TABLE t3 (i INT NOT NULL,
322 c CHAR(128) CHARACTER SET utf8 NOT NULL,
323 j INT NOT NULL) ENGINE = $type ;
324 sync_slave_with_master;
325 ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
328 eval CREATE TABLE t4 (i INT NOT NULL,
329 c CHAR(128) CHARACTER SET utf8 NOT NULL,
330 j INT NOT NULL) ENGINE = $type ;
332 eval CREATE TABLE t5 (i INT NOT NULL,
333 c CHAR(255) CHARACTER SET utf8 NOT NULL,
334 j INT NOT NULL) ENGINE = $type ;
335 sync_slave_with_master;
336 ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
339 eval CREATE TABLE t6 (i INT NOT NULL,
340 c CHAR(255) CHARACTER SET utf8 NOT NULL,
341 j INT NOT NULL) ENGINE = $type ;
342 sync_slave_with_master;
343 ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
346 eval CREATE TABLE t7 (i INT NOT NULL,
347 c CHAR(255) CHARACTER SET utf8 NOT NULL,
348 j INT NOT NULL) ENGINE = $type ;
350 --echo [expecting slave to replicate correctly]
352 INSERT INTO t1 VALUES (1, "", 1);
353 INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
354 sync_slave_with_master;
356 let $diff_tables= master:t1, slave:t1;
357 source include/diff_tables.inc;
359 --echo [expecting slave to replicate correctly]
361 INSERT INTO t2 VALUES (1, "", 1);
362 INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
363 sync_slave_with_master;
365 let $diff_tables= master:t2, slave:t2;
366 source include/diff_tables.inc;
368 --echo [expecting slave to stop]
370 INSERT INTO t3 VALUES (1, "", 1);
371 INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
374 # 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
375 call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
376 call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032");
377 --let $slave_sql_errno= 1535
378 --let $show_slave_sql_error= 1
379 --source include/wait_for_slave_sql_error.inc
381 --let $rpl_only_running_threads= 1
382 --source include/rpl_reset.inc
384 --echo [expecting slave to replicate correctly]
386 INSERT INTO t4 VALUES (1, "", 1);
387 INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
388 sync_slave_with_master;
390 let $diff_tables= master:t4, slave:t4;
391 source include/diff_tables.inc;
393 --echo [expecting slave to stop]
395 INSERT INTO t5 VALUES (1, "", 1);
396 INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
399 # 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
400 --let $slave_sql_errno= 1535
401 --let $show_slave_sql_error= 1
402 --source include/wait_for_slave_sql_error.inc
404 --source include/rpl_reset.inc
406 --echo [expecting slave to stop]
408 INSERT INTO t6 VALUES (1, "", 1);
409 INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
412 # 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
413 --let $slave_sql_errno= 1535
414 --let $show_slave_sql_error= 1
415 --source include/wait_for_slave_sql_error.inc
417 --source include/rpl_reset.inc
419 --echo [expecting slave to replicate correctly]
421 INSERT INTO t7 VALUES (1, "", 1);
422 INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
423 sync_slave_with_master;
425 let $diff_tables= master:t7, slave:t7;
426 source include/diff_tables.inc;
429 drop table t1, t2, t3, t4, t5, t6, t7;
430 sync_slave_with_master;
433 # BUG#32709: Assertion failed: trx_data->empty(), file .\log.cc, line 1293
437 eval CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=$type;
439 INSERT INTO t1 VALUES (1), (2), (3);
441 UPDATE t1 SET a = 10;
442 INSERT INTO t1 VALUES (4);
443 sync_slave_with_master;
445 let $diff_tables= master:t1, slave:t1;
446 source include/diff_tables.inc;
450 sync_slave_with_master;
453 # Bug #38230 Differences between master and slave after
454 # UPDATE or DELETE with LIMIT with pk
456 # the regression test verifies consistency via selecting
458 --disable_abort_on_error
463 DROP TABLE IF EXISTS t1, t2;
466 eval CREATE TABLE t1 (
467 `pk` int(11) NOT NULL AUTO_INCREMENT,
468 `int_nokey` int(11) NOT NULL,
469 `int_key` int(11) NOT NULL,
470 `date_key` date NOT NULL,
471 `date_nokey` date NOT NULL,
472 `time_key` time NOT NULL,
473 `time_nokey` time NOT NULL,
474 `datetime_key` datetime NOT NULL,
475 `datetime_nokey` datetime NOT NULL,
476 `varchar_key` varchar(1) NOT NULL,
477 `varchar_nokey` varchar(1) NOT NULL,
479 KEY `int_key` (`int_key`),
480 KEY `date_key` (`date_key`),
481 KEY `time_key` (`time_key`),
482 KEY `datetime_key` (`datetime_key`),
483 KEY `varchar_key` (`varchar_key`)
486 INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
488 eval CREATE TABLE t2 (
489 `pk` int(11) NOT NULL AUTO_INCREMENT,
490 `int_nokey` int(11) NOT NULL,
491 `int_key` int(11) NOT NULL,
492 `date_key` date NOT NULL,
493 `date_nokey` date NOT NULL,
494 `time_key` time NOT NULL,
495 `time_nokey` time NOT NULL,
496 `datetime_key` datetime NOT NULL,
497 `datetime_nokey` datetime NOT NULL,
498 `varchar_key` varchar(1) NOT NULL,
499 `varchar_nokey` varchar(1) NOT NULL,
501 KEY `int_key` (`int_key`),
502 KEY `date_key` (`date_key`),
503 KEY `time_key` (`time_key`),
504 KEY `datetime_key` (`datetime_key`),
505 KEY `varchar_key` (`varchar_key`)
508 INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
510 DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
511 UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
512 DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
513 DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
514 UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
515 DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
516 UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
517 DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
518 UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
520 --sync_slave_with_master
521 --echo *** results: t2 must be consistent ****
523 let $diff_tables= master:t2, slave:t2;
524 source include/diff_tables.inc;
529 --enable_abort_on_error
534 # BUG#40004: Replication failure with no PK + no indexes
537 # The test cases are taken from the bug report. It is difficult to
538 # produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
539 # with the test cases we have.
543 eval CREATE TABLE t1 (a int) ENGINE=$type;
545 INSERT IGNORE INTO t1 VALUES (NULL);
546 INSERT INTO t1 ( a ) VALUES ( 0 );
547 INSERT INTO t1 ( a ) VALUES ( 9 );
548 INSERT INTO t1 ( a ) VALUES ( 2 );
549 INSERT INTO t1 ( a ) VALUES ( 9 );
550 INSERT INTO t1 ( a ) VALUES ( 5 );
552 UPDATE t1 SET a = 5 WHERE a = 9;
553 DELETE FROM t1 WHERE a < 6;
554 UPDATE t1 SET a = 9 WHERE a < 3;
555 INSERT INTO t1 ( a ) VALUES ( 3 );
556 UPDATE t1 SET a = 0 WHERE a < 4;
557 UPDATE t1 SET a = 8 WHERE a < 5;
559 sync_slave_with_master;
561 let $diff_tables= master:t1, slave:t1;
562 source include/diff_tables.inc;
566 sync_slave_with_master;
569 # Bug #39752: Replication failure on RBR + MyISAM + no PK
572 # The test cases are taken from the bug report. It is difficult to
573 # produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
574 # with the test cases we have.
579 eval CREATE TABLE t1 (a bit) ENGINE=$type;
580 INSERT IGNORE INTO t1 VALUES (NULL);
581 INSERT INTO t1 ( a ) VALUES ( 0 );
582 UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
583 INSERT INTO t1 ( a ) VALUES ( 5 );
584 DELETE FROM t1 WHERE a < 2 LIMIT 4;
585 DELETE FROM t1 WHERE a < 9 LIMIT 4;
586 INSERT INTO t1 ( a ) VALUES ( 9 );
587 UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
588 INSERT INTO t1 ( a ) VALUES ( 8 );
589 UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
590 INSERT INTO t1 ( a ) VALUES ( 4 );
591 INSERT INTO t1 ( a ) VALUES ( 3 );
592 UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
593 DELETE FROM t1 WHERE a = 4 LIMIT 7;
594 UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
595 UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
596 DELETE FROM t1 WHERE a < 0 LIMIT 5;
597 INSERT INTO t1 ( a ) VALUES ( 5 );
598 UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
599 INSERT INTO t1 ( a ) VALUES ( 5 );
600 UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
601 DELETE FROM t1 WHERE a < 8 LIMIT 8;
602 INSERT INTO t1 ( a ) VALUES ( 6 );
603 DELETE FROM t1 WHERE a < 6 LIMIT 7;
604 UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
605 UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
606 INSERT INTO t1 ( a ) VALUES ( 7 );
607 DELETE FROM t1 WHERE a < 9 LIMIT 4;
608 INSERT INTO t1 ( a ) VALUES ( 7 );
609 INSERT INTO t1 ( a ) VALUES ( 6 );
610 UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
611 DELETE FROM t1 WHERE a = 2 LIMIT 9;
612 DELETE FROM t1 WHERE a = 1 LIMIT 4;
613 UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
614 INSERT INTO t1 ( a ) VALUES ( 0 );
615 DELETE FROM t1 WHERE a < 3 LIMIT 0;
616 UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
617 INSERT INTO t1 ( a ) VALUES ( 1 );
618 UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
621 sync_slave_with_master;
623 let $diff_tables= master:t1, slave:t1;
624 source include/diff_tables.inc;
628 sync_slave_with_master;