mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / extra / rpl_tests / rpl_mixing_engines.test
blobcbda85527f1f109beefa4a87eb9eace7c8d08e13
1 ###################################################################################
2 # This test checks if transactions that mixes transactional and non-transactional
3 # tables are correctly handled in statement mode. In an nutshell, we have what 
4 # follows:
6 # 1) "B T T C" generates in binlog the "B T T C" entries.
8 # 2) "B T T R"  generates in binlog an "empty" entry.
10 # 3) "B T N C" generates in binlog the "B T N C" entries.
12 # 4) "B T N R" generates in binlog the "B T N R" entries.
14 # 5) "T" generates in binlog the "B T C" entry.
16 # 6) "N" generates in binlog the "N" entry.
18 # 7) "M" generates in binglog the "B M C" entries.
20 # 8) "B N N T C" generates in binglog the "N N B T C" entries.
22 # 9) "B N N T R" generates in binlog the "N N B T R" entries.
24 # 10) "B N N C" generates in binglog the "N N" entries.
26 # 11) "B N N R" generates in binlog the "N N" entries.
28 # 12) "B M T C" generates in the binlog the "B M T C" entries.
30 # 13) "B M T R" generates in the binlog the "B M T R" entries.
31 ###################################################################################
33 --echo ###################################################################################
34 --echo #                                   CONFIGURATION
35 --echo ###################################################################################
36 connection master;
38 SET SQL_LOG_BIN=0;
39 CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
40 CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
41 CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
42 CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
43 CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
44 CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
45 CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
46 CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
47 SET SQL_LOG_BIN=1;
49 connection slave;
51 SET SQL_LOG_BIN=0;
52 CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
53 CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
54 CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
55 CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM;
56 CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
57 CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
58 CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
59 CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb;
60 SET SQL_LOG_BIN=1;
62 connection master;
64 DELIMITER |;
66 CREATE FUNCTION f1 () RETURNS VARCHAR(64)
67 BEGIN
68   RETURN "Testing...";
69 END|
71 CREATE FUNCTION f2 () RETURNS VARCHAR(64)
72 BEGIN
73   RETURN f1();
74 END|
76 CREATE PROCEDURE pc_i_tt_3 (IN x INT, IN y VARCHAR(64))
77 BEGIN
78   INSERT INTO tt_3 VALUES (y,x,x);
79 END|
81 CREATE TRIGGER tr_i_tt_3_to_nt_3 BEFORE INSERT ON tt_3 FOR EACH ROW
82 BEGIN
83   INSERT INTO nt_3 VALUES (NEW.a, NEW.b, NEW.c);
84 END|
86 CREATE TRIGGER tr_i_nt_4_to_tt_4 BEFORE INSERT ON nt_4 FOR EACH ROW
87 BEGIN
88   INSERT INTO tt_4 VALUES (NEW.a, NEW.b, NEW.c);
89 END|
91 DELIMITER ;|
93 --echo ###################################################################################
94 --echo #                 MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
95 --echo ###################################################################################
96 connection master;
98 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
99 --echo #
100 --echo #1) "B T T C" generates in binlog the "B T T C" entries.
101 --echo #
102 BEGIN;
103 INSERT INTO tt_1 VALUES ("new text 4", 4, "new text 4");
104 INSERT INTO tt_2 VALUES ("new text 4", 4, "new text 4");
105 COMMIT;
107 --source include/show_binlog_events.inc
109 --echo
110 --echo
111 --echo
112 --echo
113 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
114 --echo #
115 --echo #1.e) "B T T C" with error in T generates in binlog the "B T T C" entries.
116 --echo #
117 INSERT INTO tt_1 VALUES ("new text -2", -2, "new text -2");
118 BEGIN;
119 --error ER_DUP_ENTRY
120 INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -2", -2, "new text -2");
121 INSERT INTO tt_2 VALUES ("new text -3", -3, "new text -3");
122 COMMIT;
124 BEGIN;
125 INSERT INTO tt_2 VALUES ("new text -5", -5, "new text -5");
126 --error ER_DUP_ENTRY
127 INSERT INTO tt_2 VALUES ("new text -4", -4, "new text -4"), ("new text -5", -5, "new text -5");
128 COMMIT;
130 --source include/show_binlog_events.inc
132 --echo
133 --echo
134 --echo
135 --echo
136 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
137 --echo #
138 --echo #2) "B T T R"  generates in binlog an "empty" entry.
139 --echo #
140 BEGIN;
141 INSERT INTO tt_1 VALUES ("new text 5", 5, "new text 5");
142 INSERT INTO tt_2 VALUES ("new text 5", 5, "new text 5");
143 ROLLBACK;
145 --source include/show_binlog_events.inc
147 --echo
148 --echo
149 --echo
150 --echo
151 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
152 --echo #
153 --echo #2.e) "B T T R"  with error in T generates in binlog an "empty" entry.
154 --echo #
155 INSERT INTO tt_1 VALUES ("new text -7", -7, "new text -7");
156 BEGIN;
157 --error ER_DUP_ENTRY
158 INSERT INTO tt_1 VALUES ("new text -6", -6, "new text -6"), ("new text -7", -7, "new text -7");
159 INSERT INTO tt_2 VALUES ("new text -8", -8, "new text -8");
160 ROLLBACK;
162 BEGIN;
163 INSERT INTO tt_2 VALUES ("new text -10", -10, "new text -10");
164 --error ER_DUP_ENTRY
165 INSERT INTO tt_2 VALUES ("new text -9", -9, "new text -9"), ("new text -10", -10, "new text -10");
166 ROLLBACK;
168 --source include/show_binlog_events.inc
170 --echo
171 --echo
172 --echo
173 --echo
174 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
175 --echo #
176 --echo #3) "B T N C" generates in binlog the "B T N C" entries.
177 --echo #
178 BEGIN;
179 INSERT INTO tt_1 VALUES ("new text 6", 6, "new text 6");
180 INSERT INTO nt_1 VALUES ("new text 6", 6, "new text 6");
181 COMMIT;
183 --source include/show_binlog_events.inc
185 --echo
186 --echo
187 --echo
188 --echo
189 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
190 --echo #
191 --echo #3.e) "B T N C" with error in either T or N generates in binlog the "B T N C" entries.
192 --echo #
193 INSERT INTO tt_1 VALUES ("new text -12", -12, "new text -12");
194 BEGIN;
195 --error ER_DUP_ENTRY
196 INSERT INTO tt_1 VALUES ("new text -11", -11, "new text -11"), ("new text -12", -12, "new text -12");
197 INSERT INTO nt_1 VALUES ("new text -13", -13, "new text -13");
198 COMMIT;
200 BEGIN;
201 INSERT INTO tt_1 VALUES ("new text -14", -14, "new text -14");
202 INSERT INTO nt_1 VALUES ("new text -16", -16, "new text -16");
203 --error ER_DUP_ENTRY
204 INSERT INTO nt_1 VALUES ("new text -15", -15, "new text -15"), ("new text -16", -16, "new text -16");
205 COMMIT;
207 --source include/show_binlog_events.inc
209 --echo
210 --echo
211 --echo
212 --echo
213 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
214 --echo #
215 --echo #4) "B T N R" generates in binlog the "B T N R" entries.
216 --echo #
217 BEGIN;
218 INSERT INTO tt_1 VALUES ("new text 7", 7, "new text 7");
219 INSERT INTO nt_1 VALUES ("new text 7", 7, "new text 7");
220 ROLLBACK;
222 --source include/show_binlog_events.inc
224 --echo
225 --echo
226 --echo
227 --echo
228 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
229 --echo #
230 --echo #4.e) "B T N R" with error in either T or N generates in binlog the "B T N R" entries.
231 --echo #
232 INSERT INTO tt_1 VALUES ("new text -17", -17, "new text -17");
233 BEGIN;
234 --error ER_DUP_ENTRY
235 INSERT INTO tt_1 VALUES ("new text -16", -16, "new text -16"), ("new text -17", -17, "new text -17");
236 INSERT INTO nt_1 VALUES ("new text -18", -18, "new text -18");
237 ROLLBACK;
239 BEGIN;
240 INSERT INTO tt_1 VALUES ("new text -19", -19, "new text -19");
241 INSERT INTO nt_1 VALUES ("new text -21", -21, "new text -21");
242 --error ER_DUP_ENTRY
243 INSERT INTO nt_1 VALUES ("new text -20", -20, "new text -20"), ("new text -21", -21, "new text -21");
244 ROLLBACK;
246 --source include/show_binlog_events.inc
248 --echo
249 --echo
250 --echo
251 --echo
252 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
253 --echo #
254 --echo #5) "T" generates in binlog the "B T C" entry.
255 --echo #
256 INSERT INTO tt_1 VALUES ("new text 8", 8, "new text 8");
258 --source include/show_binlog_events.inc
260 --echo
261 --echo
262 --echo
263 --echo
264 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
265 --echo #
266 --echo #5.e) "T" with error in T generates in binlog an "empty" entry.
267 --echo #
268 INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1");
269 --error ER_DUP_ENTRY
270 INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -22", -22, "new text -22");
271 --error ER_DUP_ENTRY
272 INSERT INTO tt_1 VALUES ("new text -23", -23, "new text -23"), ("new text -1", -1, "new text -1");
274 --source include/show_binlog_events.inc
276 --echo
277 --echo
278 --echo
279 --echo
280 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
281 --echo #
282 --echo #6) "N" generates in binlog the "N" entry.
283 --echo #
284 INSERT INTO nt_1 VALUES ("new text 9", 9, "new text 9");
286 --source include/show_binlog_events.inc
288 --echo
289 --echo
290 --echo
291 --echo
292 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
293 --echo #
294 --echo #6.e) "N" with error in N generates in binlog an empty entry if the error
295 --echo # happens in the first tuple. Otherwise, generates the "N" entry and
296 --echo # the error is appended.
297 --echo #
298 INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1");
299 --error ER_DUP_ENTRY
300 INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1");
301 --error ER_DUP_ENTRY
302 INSERT INTO nt_1 VALUES ("new text -24", -24, "new text -24"), ("new text -1", -1, "new text -1");
304 --source include/show_binlog_events.inc
306 --echo
307 --echo
308 --echo
309 --echo
310 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
311 --echo #
312 --echo #7) "M" generates in binglog the "B M C" entries.
313 --echo #
315 DELETE FROM nt_1;
317 INSERT INTO nt_1 SELECT * FROM tt_1;
319 DELETE FROM tt_1;
321 INSERT INTO tt_1 SELECT * FROM nt_1; 
323 INSERT INTO tt_3 VALUES ("new text 000", 000, '');
325 INSERT INTO tt_3 VALUES("new text 100", 100, f1());
327 INSERT INTO nt_4 VALUES("new text 100", 100, f1());
329 INSERT INTO tt_3 VALUES("new text 200", 200, f2());
331 INSERT INTO nt_4 VALUES ("new text 300", 300, '');
333 INSERT INTO nt_4 VALUES ("new text 400", 400, f1());
335 INSERT INTO nt_4 VALUES ("new text 500", 500, f2());
337 CALL pc_i_tt_3(600, "Testing...");
339 UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 1", nt_4.a= "new text 1", tt_3.a= "new text 1", tt_4.a= "new text 1" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
341 UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a = "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
343 UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 3", nt_3.a= "new text 3", nt_4.a= "new text 3", tt_4.a = "new text 3" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
345 UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 4", nt_3.a= "new text 4", nt_4.a= "new text 4", tt_4.a = "new text 4" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
347 --source include/show_binlog_events.inc
349 --echo
350 --echo
351 --echo
352 --echo
353 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
354 --echo #
355 --echo #7.e) "M" with error in M generates in binglog the "B M R" entries.
356 --echo #
358 INSERT INTO nt_3 VALUES ("new text -26", -26, '');
359 SELECT * FROM tt_3;
360 --error ER_DUP_ENTRY
361 INSERT INTO tt_3 VALUES ("new text -25", -25, ''), ("new text -26", -26, '');
362 SELECT * FROM tt_3;
364 INSERT INTO tt_4 VALUES ("new text -26", -26, '');
365 SELECT * FROM nt_4;
366 --error ER_DUP_ENTRY
367 INSERT INTO nt_4 VALUES ("new text -25", -25, ''), ("new text -26", -26, '');
368 SELECT * FROM nt_4;
370 --source include/show_binlog_events.inc
372 --echo
373 --echo
374 --echo
375 --echo
376 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
377 --echo #
378 --echo #8) "B N N T C" generates in binglog the "N N B T C" entries.
379 --echo #
380 BEGIN;
381 INSERT INTO nt_1 VALUES ("new text 10", 10, "new text 10");
382 INSERT INTO nt_2 VALUES ("new text 10", 10, "new text 10");
383 INSERT INTO tt_1 VALUES ("new text 10", 10, "new text 10");
384 COMMIT;
386 --source include/show_binlog_events.inc
388 --echo
389 --echo
390 --echo
391 --echo
392 --echo #
393 --echo #8.e) "B N N T R" See 6.e and 9.e.
394 --echo #
396 --echo
397 --echo
398 --echo
399 --echo
400 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
401 --echo #
402 --echo #9) "B N N T R" generates in binlog the "N N B T R" entries.
403 --echo #
404 BEGIN;
405 INSERT INTO nt_1 VALUES ("new text 11", 11, "new text 11");
406 INSERT INTO nt_2 VALUES ("new text 11", 11, "new text 11");
407 INSERT INTO tt_1 VALUES ("new text 11", 11, "new text 11");
408 ROLLBACK;
410 --source include/show_binlog_events.inc
412 --echo
413 --echo
414 --echo
415 --echo
416 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
417 --echo #
418 --echo #9.e) "B N N T R" with error in N generates in binlog the "N N B T R" entries.
419 --echo #
420 BEGIN;
421 INSERT INTO nt_1 VALUES ("new text -25", -25, "new text -25");
422 INSERT INTO nt_2 VALUES ("new text -25", -25, "new text -25");
423 --error ER_DUP_ENTRY
424 INSERT INTO nt_2 VALUES ("new text -26", -26, "new text -26"), ("new text -25", -25, "new text -25");
425 INSERT INTO tt_1 VALUES ("new text -27", -27, "new text -27");
426 ROLLBACK;
428 --source include/show_binlog_events.inc
430 --echo
431 --echo
432 --echo
433 --echo
434 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
435 --echo #
436 --echo #10) "B N N C" generates in binglog the "N N" entries.
437 --echo #
438 BEGIN;
439 INSERT INTO nt_1 VALUES ("new text 12", 12, "new text 12");
440 INSERT INTO nt_2 VALUES ("new text 12", 12, "new text 12");
441 COMMIT;
443 --source include/show_binlog_events.inc
445 --echo
446 --echo
447 --echo
448 --echo
449 --echo #
450 --echo #10.e) "B N N C" See 6.e and 9.e.
451 --echo #
453 --echo
454 --echo
455 --echo
456 --echo
457 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
458 --echo #
459 --echo #11) "B N N R" generates in binlog the "N N" entries.
460 --echo #
461 BEGIN;
462 INSERT INTO nt_1 VALUES ("new text 13", 13, "new text 13");
463 INSERT INTO nt_2 VALUES ("new text 13", 13, "new text 13");
464 ROLLBACK;
466 --source include/show_binlog_events.inc
468 --echo
469 --echo
470 --echo
471 --echo
472 --echo #
473 --echo #11.e) "B N N R" See 6.e and 9.e.
474 --echo #
476 --echo
477 --echo
478 --echo
479 --echo
480 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
481 --echo #
482 --echo #12) "B M T C" generates in the binlog the "B M T C" entries.
483 --echo #
484 DELETE FROM nt_1;
485 BEGIN;
486 INSERT INTO nt_1 SELECT * FROM tt_1;
487 INSERT INTO tt_2 VALUES ("new text 14", 14, "new text 14");
488 COMMIT;
490 DELETE FROM tt_1;
491 BEGIN;
492 INSERT INTO tt_1 SELECT * FROM nt_1;
493 INSERT INTO tt_2 VALUES ("new text 15", 15, "new text 15");
494 COMMIT;
496 BEGIN;
497 INSERT INTO tt_3 VALUES ("new text 700", 700, '');
498 INSERT INTO tt_1 VALUES ("new text 800", 800, '');
499 COMMIT;
501 BEGIN;
502 INSERT INTO tt_3 VALUES("new text 900", 900, f1());
503 INSERT INTO tt_1 VALUES ("new text 1000", 1000, '');
504 COMMIT;
506 BEGIN;
507 INSERT INTO tt_3 VALUES(1100, 1100, f2());
508 INSERT INTO tt_1 VALUES ("new text 1200", 1200, '');
509 COMMIT;
511 BEGIN;
512 INSERT INTO nt_4 VALUES ("new text 1300", 1300, '');
513 INSERT INTO tt_1 VALUES ("new text 1400", 1400, '');
514 COMMIT;
516 BEGIN;
517 INSERT INTO nt_4 VALUES("new text 1500", 1500, f1());
518 INSERT INTO tt_1 VALUES ("new text 1600", 1600, '');
519 COMMIT;
521 BEGIN;
522 INSERT INTO nt_4 VALUES("new text 1700", 1700, f2());
523 INSERT INTO tt_1 VALUES ("new text 1800", 1800, '');
524 COMMIT;
526 BEGIN;
527 CALL pc_i_tt_3(1900, "Testing...");
528 INSERT INTO tt_1 VALUES ("new text 2000", 2000, '');
529 COMMIT;
531 BEGIN;
532 UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 5", nt_4.a= "new text 5", tt_3.a= "new text 5", tt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
533 INSERT INTO tt_1 VALUES ("new text 2100", 2100, '');
534 COMMIT;
536 BEGIN;
537 UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 6", tt_4.a= "new text 6", nt_3.a= "new text 6", nt_4.a = "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
538 INSERT INTO tt_1 VALUES ("new text 2200", 2200, '');
539 COMMIT;
541 BEGIN;
542 UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 7", nt_3.a= "new text 7", nt_4.a= "new text 7", tt_4.a = "new text 7" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
543 INSERT INTO tt_1 VALUES ("new text 2300", 2300, '');
544 COMMIT;
546 BEGIN;
547 UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 8", nt_3.a= "new text 8", nt_4.a= "new text 8", tt_4.a = "new text 8" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
548 INSERT INTO tt_1 VALUES ("new text 2400", 2400, '');
549 COMMIT;
551 --source include/show_binlog_events.inc
553 --echo
554 --echo
555 --echo
556 --echo
557 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
558 --echo #
559 --echo #12.e) "B M T C" with error in M generates in the binlog the "B M T C" entries.
560 --echo #  
562 --echo # There is a bug in the slave that needs to be fixed before enabling
563 --echo # this part of the test. A bug report will be filed referencing this
564 --echo # test case.
566 BEGIN;
567 INSERT INTO nt_3 VALUES ("new text -28", -28, '');
568 --error ER_DUP_ENTRY
569 INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
570 INSERT INTO tt_1 VALUES ("new text -27", -27, '');
571 COMMIT;
573 BEGIN;
574 INSERT INTO tt_4 VALUES ("new text -28", -28, '');
575 --error ER_DUP_ENTRY
576 INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, '');
577 INSERT INTO tt_1 VALUES ("new text -28", -28, '');
578 COMMIT;
580 --source include/show_binlog_events.inc
582 --echo
583 --echo
584 --echo
585 --echo
586 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
587 --echo #
588 --echo #13) "B M T R" generates in the binlog the "B M T R" entries
589 --echo #
591 DELETE FROM nt_1;
592 BEGIN;
593 INSERT INTO nt_1 SELECT * FROM tt_1;
594 INSERT INTO tt_2 VALUES ("new text 17", 17, "new text 17");
595 ROLLBACK;
597 DELETE FROM tt_1;
598 BEGIN;
599 INSERT INTO tt_1 SELECT * FROM nt_1;
600 INSERT INTO tt_2 VALUES ("new text 18", 18, "new text 18");
601 ROLLBACK;
602 INSERT INTO tt_1 SELECT * FROM nt_1;
604 BEGIN;
605 INSERT INTO tt_3 VALUES ("new text 2500", 2500, '');
606 INSERT INTO tt_1 VALUES ("new text 2600", 2600, '');
607 ROLLBACK;
609 BEGIN;
610 INSERT INTO tt_3 VALUES("new text 2700", 2700, f1());
611 INSERT INTO tt_1 VALUES ("new text 2800", 2800, '');
612 ROLLBACK;
614 BEGIN;
615 INSERT INTO tt_3 VALUES(2900, 2900, f2());
616 INSERT INTO tt_1 VALUES ("new text 3000", 3000, '');
617 ROLLBACK;
619 BEGIN;
620 INSERT INTO nt_4 VALUES ("new text 3100", 3100, '');
621 INSERT INTO tt_1 VALUES ("new text 3200", 3200, '');
622 ROLLBACK;
624 BEGIN;
625 INSERT INTO nt_4 VALUES("new text 3300", 3300, f1());
626 INSERT INTO tt_1 VALUES ("new text 3400", 3400, '');
627 ROLLBACK;
629 BEGIN;
630 INSERT INTO nt_4 VALUES("new text 3500", 3500, f2());
631 INSERT INTO tt_1 VALUES ("new text 3600", 3600, '');
632 ROLLBACK;
634 BEGIN;
635 CALL pc_i_tt_3(3700, "Testing...");
636 INSERT INTO tt_1 VALUES ("new text 3700", 3700, '');
637 ROLLBACK;
639 BEGIN;
640 UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 9", nt_4.a= "new text 9", tt_3.a= "new text 9", tt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
641 INSERT INTO tt_1 VALUES ("new text 3800", 3800, '');
642 ROLLBACK;
644 BEGIN;
645 UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 10", tt_4.a= "new text 10", nt_3.a= "new text 10", nt_4.a = "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
646 INSERT INTO tt_1 VALUES ("new text 3900", 3900, '');
647 ROLLBACK;
649 BEGIN;
650 UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 11", nt_3.a= "new text 11", nt_4.a= "new text 11", tt_4.a = "new text 11" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
651 INSERT INTO tt_1 VALUES ("new text 4000", 4000, '');
652 ROLLBACK;
654 BEGIN;
655 UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 12", nt_3.a= "new text 12", nt_4.a= "new text 12", tt_4.a = "new text 12" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100;
656 INSERT INTO tt_1 VALUES ("new text 4100", 4100, '');
657 ROLLBACK;
659 --source include/show_binlog_events.inc
661 --echo
662 --echo
663 --echo
664 --echo
665 let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
666 --echo #
667 --echo #13.e) "B M T R" with error in M generates in the binlog the "B M T R" entries.
668 --echo #
670 BEGIN;
671 INSERT INTO nt_3 VALUES ("new text -30", -30, '');
672 --error ER_DUP_ENTRY
673 INSERT INTO tt_3 VALUES ("new text -29", -29, ''), ("new text -30", -30, '');
674 INSERT INTO tt_1 VALUES ("new text -30", -30, '');
675 ROLLBACK;
677 BEGIN;
678 INSERT INTO tt_4 VALUES ("new text -30", -30, '');
679 --error ER_DUP_ENTRY
680 INSERT INTO nt_4 VALUES ("new text -29", -29, ''), ("new text -30", -30, '');
681 INSERT INTO tt_1 VALUES ("new text -31", -31, '');
682 ROLLBACK;
684 --source include/show_binlog_events.inc
686 connection master;
687 sync_slave_with_master;
689 --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-master.sql
690 --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-slave.sql
691 --diff_files $MYSQLTEST_VARDIR/tmp/test-master.sql $MYSQLTEST_VARDIR/tmp/test-slave.sql
693 --echo ###################################################################################
694 --echo #                                        CLEAN
695 --echo ###################################################################################
697 connection master;
698 DROP TABLE tt_1;
699 DROP TABLE tt_2;
700 DROP TABLE tt_3;
701 DROP TABLE tt_4;
702 DROP TABLE nt_1;
703 DROP TABLE nt_2;
704 DROP TABLE nt_3;
705 DROP TABLE nt_4;
706 DROP PROCEDURE pc_i_tt_3;
707 DROP FUNCTION f1;
708 DROP FUNCTION f2;
710 sync_slave_with_master;