Debian Codegraph @

mysql-test/suite/ndb_binlog/t/ndb_binlog_event_clean.test

raw
1 --source include/have_multi_ndb.inc
2 --source include/have_binlog_format_mixed_or_row.inc
3 --echo # We are using some debug-only features in this test
4 --source include/have_debug.inc
5 --source include/not_windows.inc
6
7 --echo Explore some event weirdness
8
9 --let $SHOW_DETAIL=0
10
11 connection server1;
12 use test;
13
14 create table test.synch(x int primary key auto_increment) engine=ndb;
15
16 --disable_result_log
17 show create table test.synch;
18 --enable_result_log
19 reset master;
20
21 --echo Create table with tableId X and blob part tables :
22 --echo NDB\$BLOB_X_2
23 --echo NDB\$BLOB_X_3
24 --echo NDB\$BLOB_X_4
25 --echo Event will also be created
26 --echo REPL\$test/t1
27 --echo Plus
28 --echo NDB\$BLOBEVENT_REPL\$test/t1_2
29 --echo NDB\$BLOBEVENT_REPL\$test/t1_3
30 --echo NDB\$BLOBEVENT_REPL\$test/t1_4
31
32 connection server1;
33 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
34
35 insert into test.t1 values(0, "b", "c", "d");
36
37 connection server1;
38 --disable_query_log
39 --disable_result_log
40 insert into test.synch values (null);
41 --enable_result_log
42 --enable_query_log
43
44 # Wait for epoch boundary
45 --disable_query_log
46 --disable_result_log
47 show binlog events;
48 --enable_result_log
49 --enable_query_log
50
51 --disable_query_log
52 let $MYSQLD_DATADIR= `select @@datadir;`;
53 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
54
55 create table raw_binlog_rows (txt varchar(1000));
56
57 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
58
59 --echo "Check that the binlog contains the inserted row"
60 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
61 drop table raw_binlog_rows;
62 --enable_query_log
63 reset master;
64
65 connection server2;
66 --disable_query_log
67 --disable_result_log
68 insert into test.synch values (null);
69 --enable_result_log
70 --enable_query_log
71
72 # Wait for epoch boundary
73 --disable_query_log
74 --disable_result_log
75 show binlog events;
76 --enable_result_log
77 --enable_query_log
78
79 --disable_query_log
80 let $MYSQLD_DATADIR= `select @@datadir;`;
81 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
82
83 create table raw_binlog_rows (txt varchar(1000));
84
85 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
86
87 --echo "Check that the binlog contains the inserted row"
88 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
89 drop table raw_binlog_rows;
90 --enable_query_log
91 reset master;
92
93 --echo Show tables and events
94
95 if ($SHOW_DETAIL)
96 {
97 --exec $NDB_SHOW_TABLES -p -t2
98 --exec echo Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
99 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
100 }
101 --echo Expecting 3 BLOB events for t1
102 --source ndb_binlog_count_event_t1.inc
103
104 --echo Drop table, and show tables and events gone
105
106 drop table test.t1;
107
108 if ($SHOW_DETAIL)
109 {
110 --exec $NDB_SHOW_TABLES -t2
111 --exec echo Expecting 0 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
112 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
113 }
114 --echo Expecting 0 BLOB events for t1
115 --source ndb_binlog_count_event_t1.inc
116
117 --echo Recreate the table
118 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
119
120 insert into test.t1 values(0, "b", "c", "d");
121
122 connection server1;
123 --disable_query_log
124 --disable_result_log
125 insert into test.synch values (null);
126 --enable_result_log
127 --enable_query_log
128
129 # Wait for epoch boundary
130 --disable_query_log
131 --disable_result_log
132 show binlog events;
133 --enable_result_log
134 --enable_query_log
135
136 --disable_query_log
137 let $MYSQLD_DATADIR= `select @@datadir;`;
138 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
139
140 create table raw_binlog_rows (txt varchar(1000));
141
142 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
143
144 --echo "Check that the binlog contains the inserted row"
145 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
146 drop table raw_binlog_rows;
147 --enable_query_log
148 reset master;
149
150 connection server2;
151 --disable_query_log
152 --disable_result_log
153 insert into test.synch values (null);
154 --enable_result_log
155 --enable_query_log
156
157 # Wait for epoch boundary
158 --disable_query_log
159 --disable_result_log
160 show binlog events;
161 --enable_result_log
162 --enable_query_log
163
164 --disable_query_log
165 let $MYSQLD_DATADIR= `select @@datadir;`;
166 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
167
168 create table raw_binlog_rows (txt varchar(1000));
169
170 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
171
172 --echo "Check that the binlog contains the inserted row"
173 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
174 drop table raw_binlog_rows;
175 --enable_query_log
176 reset master;
177
178 connection server1;
179
180 if ($SHOW_DETAIL)
181 {
182 --exec $NDB_SHOW_TABLES -t2
183 --exec echo Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
184 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
185 }
186 --echo Expecting 3 BLOB events for t1
187 --source ndb_binlog_count_event_t1.inc
188
189 --echo Drop the table, but fail to drop the event(s)
190 set @save_debug = @@global.debug;
191 set global debug='-d'; # Switch DEBUG/TRACING OFF
192 set global debug='+d,ndb_skip_drop_event';
193
194 drop table test.t1;
195 show warnings;
196
197 --echo Expect : The tables are gone, but their events still hang around
198
199 if ($SHOW_DETAIL)
200 {
201 --exec $NDB_SHOW_TABLES -t2
202 --exec echo Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
203 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
204 }
205 --echo Expecting 3 BLOB events for t1
206 --source ndb_binlog_count_event_t1.inc
207
208 --echo Redo the drop command to clear MySQLD metadata
209 --echo Expect an error as the table doesn't exist in Ndb
210 --error 1051
211 drop table test.t1;
212 set global debug='+d'; # Switch DEBUG/TRACING ON
213 set global debug=@save_debug;
214
215 --echo Expect : The tables are gone, but their events still hang around
216
217 if ($SHOW_DETAIL)
218 {
219 --exec $NDB_SHOW_TABLES -t2
220 --exec echo Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
221 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
222 }
223 --echo Expecting 3 BLOB events for t1
224 --source ndb_binlog_count_event_t1.inc
225
226 --echo ----------------------------------------------------------------------
227 --echo Case 1 : Create a table with the same tableId and same number of blobs
228 --echo Expect : Creation ok with no errors
229 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
230 show warnings;
231
232 insert into test.t1 values(0, "b", "c", "d");
233
234 connection server1;
235 --disable_query_log
236 --disable_result_log
237 insert into test.synch values (null);
238 --enable_result_log
239 --enable_query_log
240
241 # Wait for epoch boundary
242 --disable_query_log
243 --disable_result_log
244 show binlog events;
245 --enable_result_log
246 --enable_query_log
247
248 --disable_query_log
249 let $MYSQLD_DATADIR= `select @@datadir;`;
250 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
251
252 create table raw_binlog_rows (txt varchar(1000));
253
254 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
255
256 --echo "Check that the binlog contains the inserted row"
257 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
258 drop table raw_binlog_rows;
259 --enable_query_log
260 reset master;
261
262 connection server2;
263 --disable_query_log
264 --disable_result_log
265 insert into test.synch values (null);
266 --enable_result_log
267 --enable_query_log
268
269 # Wait for epoch boundary
270 --disable_query_log
271 --disable_result_log
272 show binlog events;
273 --enable_result_log
274 --enable_query_log
275
276 --disable_query_log
277 let $MYSQLD_DATADIR= `select @@datadir;`;
278 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
279
280 create table raw_binlog_rows (txt varchar(1000));
281
282 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
283
284 --echo "Check that the binlog contains the inserted row"
285 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
286 drop table raw_binlog_rows;
287 --enable_query_log
288 reset master;
289
290 connection server1;
291
292 if ($SHOW_DETAIL)
293 {
294 --exec $NDB_SHOW_TABLES -t2
295 --exec echo Case 1 : Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
296 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
297 }
298 --echo Expecting 3 BLOB events for t1
299 --source ndb_binlog_count_event_t1.inc
300
301 --echo Drop the table, but fail to drop the event(s)
302 set global debug='-d'; # Switch DEBUG/TRACING OFF
303 set global debug='+d,ndb_skip_drop_event';
304
305 drop table test.t1;
306 show warnings;
307
308 --echo Redo the drop command to clear MySQLD metadata
309 --echo Expect an error as the table doesn't exist in Ndb
310 --error 1051
311 drop table test.t1;
312 set global debug='+d'; # Switch DEBUG/TRACING ON
313 set global debug=@save_debug;
314
315 if ($SHOW_DETAIL)
316 {
317 --exec $NDB_SHOW_TABLES -t2
318 --exec echo Case 1 : Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
319 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
320 }
321 --echo Expecting 3 BLOB events for t1
322 --source ndb_binlog_count_event_t1.inc
323
324 --echo ----------------------------------------------------------------------
325 --echo Case 2 : Create a table with the same tableid + name, more blobs
326 --echo Expect : No errors, event setup includes one event for each blob column
327
328 create table test.t1 (a int primary key, b text, c text, d text, e text) engine=ndb;
329 show warnings;
330
331 insert into test.t1 values(0, "b", "c", "d", "e");
332
333 connection server1;
334 --disable_query_log
335 --disable_result_log
336 insert into test.synch values (null);
337 --enable_result_log
338 --enable_query_log
339
340 # Wait for epoch boundary
341 --disable_query_log
342 --disable_result_log
343 show binlog events;
344 --enable_result_log
345 --enable_query_log
346
347 --disable_query_log
348 let $MYSQLD_DATADIR= `select @@datadir;`;
349 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
350
351 create table raw_binlog_rows (txt varchar(1000));
352
353 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
354
355 --echo "Check that the binlog contains the inserted row"
356 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
357 drop table raw_binlog_rows;
358 --enable_query_log
359 reset master;
360
361 connection server2;
362 --disable_query_log
363 --disable_result_log
364 insert into test.synch values (null);
365 --enable_result_log
366 --enable_query_log
367
368 # Wait for epoch boundary
369 --disable_query_log
370 --disable_result_log
371 show binlog events;
372 --enable_result_log
373 --enable_query_log
374
375 --disable_query_log
376 let $MYSQLD_DATADIR= `select @@datadir;`;
377 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
378
379 create table raw_binlog_rows (txt varchar(1000));
380
381 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
382
383 --echo "Check that the binlog contains the inserted row"
384 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
385 drop table raw_binlog_rows;
386 --enable_query_log
387 reset master;
388
389 connection server1;
390
391 if ($SHOW_DETAIL)
392 {
393 --exec $NDB_SHOW_TABLES -t2
394 --exec echo Case 2 : Expecting 4 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
395 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
396 }
397 --echo Expecting 4 BLOB events for t1
398 --source ndb_binlog_count_event_t1.inc
399
400 --echo Drop the table, but fail to drop the event(s)
401 set global debug='-d'; # Switch DEBUG/TRACING OFF
402 set global debug='+d,ndb_skip_drop_event';
403
404 drop table test.t1;
405 show warnings;
406
407 --echo Redo the drop command to clear MySQLD metadata
408 --echo Expect an error as the table doesn't exist in Ndb
409 --error 1051
410 drop table test.t1;
411 set global debug='+d'; # Switch DEBUG/TRACING ON
412 set global debug=@save_debug;
413
414 if ($SHOW_DETAIL)
415 {
416 --exec $NDB_SHOW_TABLES -t2
417 --exec echo Case 2 : Expecting 4 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
418 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
419 }
420 --echo Expecting 4 BLOB events for t1
421 --source ndb_binlog_count_event_t1.inc
422
423 --echo ----------------------------------------------------------------------
424 --echo Case 3 : Create a table with the same tableid + name, fewer blobs
425 --echo Expect : No errors, extra blob events dropped
426
427 create table test.t1 (a int primary key, b text) engine=ndb;
428 show warnings;
429
430 insert into test.t1 values(0, "b");
431
432 connection server1;
433 --disable_query_log
434 --disable_result_log
435 insert into test.synch values (null);
436 --enable_result_log
437 --enable_query_log
438
439 # Wait for epoch boundary
440 --disable_query_log
441 --disable_result_log
442 show binlog events;
443 --enable_result_log
444 --enable_query_log
445
446 --disable_query_log
447 let $MYSQLD_DATADIR= `select @@datadir;`;
448 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
449
450 create table raw_binlog_rows (txt varchar(1000));
451
452 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
453
454 --echo "Check that the binlog contains the inserted row"
455 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
456 drop table raw_binlog_rows;
457 --enable_query_log
458 reset master;
459
460 connection server2;
461 --disable_query_log
462 --disable_result_log
463 insert into test.synch values (null);
464 --enable_result_log
465 --enable_query_log
466
467 # Wait for epoch boundary
468 --disable_query_log
469 --disable_result_log
470 show binlog events;
471 --enable_result_log
472 --enable_query_log
473
474 --disable_query_log
475 let $MYSQLD_DATADIR= `select @@datadir;`;
476 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
477
478 create table raw_binlog_rows (txt varchar(1000));
479
480 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
481
482 --echo "Check that the binlog contains the inserted row"
483 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
484 drop table raw_binlog_rows;
485 --enable_query_log
486 reset master;
487
488 connection server1;
489
490 if ($SHOW_DETAIL)
491 {
492 --exec $NDB_SHOW_TABLES -t2
493 --exec echo Case 3 : Expecting 1 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
494 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
495 }
496 --echo Expecting 1 BLOB events for t1
497 --source ndb_binlog_count_event_t1.inc
498
499 --echo Drop the table, but fail to drop the event(s)
500 set global debug='-d'; # Switch DEBUG/TRACING OFF
501 set global debug='+d,ndb_skip_drop_event';
502
503 drop table test.t1;
504 show warnings;
505
506 --echo Redo the drop command to clear MySQLD metadata
507 --echo Expect an error as the table doesn't exist in Ndb
508 --error 1051
509 drop table test.t1;
510 set global debug='+d'; # Switch DEBUG/TRACING ON
511 set global debug=@save_debug;
512
513 if ($SHOW_DETAIL)
514 {
515 --exec $NDB_SHOW_TABLES -t2
516 --exec echo Case 3 : Expecting 1 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
517 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
518 }
519 --echo Expecting 1 BLOB events for t1
520 --source ndb_binlog_count_event_t1.inc
521
522 --echo ----------------------------------------------------------------------
523 --echo Case 4 : Create a table with the same tableid + name, different numbered blobs
524 --echo Expect : No errors, event for new numbered blob, others gone
525 create table test.t1 (a int primary key, b int, c text) engine=ndb;
526 show warnings;
527
528 insert into test.t1 values(0, 1, "c");
529
530 connection server1;
531 --disable_query_log
532 --disable_result_log
533 insert into test.synch values (null);
534 --enable_result_log
535 --enable_query_log
536
537 # Wait for epoch boundary
538 --disable_query_log
539 --disable_result_log
540 show binlog events;
541 --enable_result_log
542 --enable_query_log
543
544 --disable_query_log
545 let $MYSQLD_DATADIR= `select @@datadir;`;
546 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
547
548 create table raw_binlog_rows (txt varchar(1000));
549
550 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
551
552 --echo "Check that the binlog contains the inserted row"
553 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
554 drop table raw_binlog_rows;
555 --enable_query_log
556 reset master;
557
558 connection server2;
559 --disable_query_log
560 --disable_result_log
561 insert into test.synch values (null);
562 --enable_result_log
563 --enable_query_log
564
565 # Wait for epoch boundary
566 --disable_query_log
567 --disable_result_log
568 show binlog events;
569 --enable_result_log
570 --enable_query_log
571
572 --disable_query_log
573 let $MYSQLD_DATADIR= `select @@datadir;`;
574 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
575
576 create table raw_binlog_rows (txt varchar(1000));
577
578 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
579
580 --echo "Check that the binlog contains the inserted row"
581 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
582 drop table raw_binlog_rows;
583 --enable_query_log
584 reset master;
585
586 connection server1;
587
588 if ($SHOW_DETAIL)
589 {
590 --exec $NDB_SHOW_TABLES -t2
591 --exec echo Case 4 : Expecting 1 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
592 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
593 }
594 --echo Expecting 1 BLOB events for t1
595 --source ndb_binlog_count_event_t1.inc
596
597 --echo Drop the table, but fail to drop the event(s)
598 set global debug='-d'; # Switch DEBUG/TRACING OFF
599 set global debug='+d,ndb_skip_drop_event';
600
601 drop table test.t1;
602 show warnings;
603
604 --echo Redo the drop command to clear MySQLD metadata
605 --echo Expect an error as the table doesn't exist in Ndb
606 --error 1051
607 drop table test.t1;
608 set global debug='+d'; # Switch DEBUG/TRACING ON
609 set global debug=@save_debug;
610
611 --echo Cleanup table in cluster
612 --echo Expect : All t1 related events and tables gone
613 create table test.t1 (a int primary key, b text) engine=ndb;
614
615 insert into test.t1 values(0, "b");
616
617 connection server1;
618 --disable_query_log
619 --disable_result_log
620 insert into test.synch values (null);
621 --enable_result_log
622 --enable_query_log
623
624 # Wait for epoch boundary
625 --disable_query_log
626 --disable_result_log
627 show binlog events;
628 --enable_result_log
629 --enable_query_log
630
631 --disable_query_log
632 let $MYSQLD_DATADIR= `select @@datadir;`;
633 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
634
635 create table raw_binlog_rows (txt varchar(1000));
636
637 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
638
639 --echo "Check that the binlog contains the inserted row"
640 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
641 drop table raw_binlog_rows;
642 --enable_query_log
643 reset master;
644
645 connection server2;
646 --disable_query_log
647 --disable_result_log
648 insert into test.synch values (null);
649 --enable_result_log
650 --enable_query_log
651
652 # Wait for epoch boundary
653 --disable_query_log
654 --disable_result_log
655 show binlog events;
656 --enable_result_log
657 --enable_query_log
658
659 --disable_query_log
660 let $MYSQLD_DATADIR= `select @@datadir;`;
661 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
662
663 create table raw_binlog_rows (txt varchar(1000));
664
665 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
666
667 --echo "Check that the binlog contains the inserted row"
668 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
669 drop table raw_binlog_rows;
670 --enable_query_log
671 reset master;
672
673 connection server1;
674
675 drop table test.t1;
676
677 if ($SHOW_DETAIL)
678 {
679 --exec $NDB_SHOW_TABLES -t2
680 --exec echo Case 4 : Expecting 0 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
681 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
682 }
683 --echo Expecting 0 BLOB events for t1
684 --source ndb_binlog_count_event_t1.inc
685
686 --echo Create table with 3 blob columns
687 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
688
689 insert into test.t1 values(0, "b", "c", "d");
690
691 connection server1;
692 --disable_query_log
693 --disable_result_log
694 insert into test.synch values (null);
695 --enable_result_log
696 --enable_query_log
697
698 # Wait for epoch boundary
699 --disable_query_log
700 --disable_result_log
701 show binlog events;
702 --enable_result_log
703 --enable_query_log
704
705 --disable_query_log
706 let $MYSQLD_DATADIR= `select @@datadir;`;
707 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
708
709 create table raw_binlog_rows (txt varchar(1000));
710
711 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
712
713 --echo "Check that the binlog contains the inserted row"
714 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
715 drop table raw_binlog_rows;
716 --enable_query_log
717 reset master;
718
719 connection server2;
720 --disable_query_log
721 --disable_result_log
722 insert into test.synch values (null);
723 --enable_result_log
724 --enable_query_log
725
726 # Wait for epoch boundary
727 --disable_query_log
728 --disable_result_log
729 show binlog events;
730 --enable_result_log
731 --enable_query_log
732
733 --disable_query_log
734 let $MYSQLD_DATADIR= `select @@datadir;`;
735 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
736
737 create table raw_binlog_rows (txt varchar(1000));
738
739 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
740
741 --echo "Check that the binlog contains the inserted row"
742 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
743 drop table raw_binlog_rows;
744 --enable_query_log
745 reset master;
746
747 connection server1;
748
749 if ($SHOW_DETAIL)
750 {
751 --exec $NDB_SHOW_TABLES -t2
752 --exec echo Case 4 : Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
753 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
754 }
755 --echo Expecting 3 BLOB events for t1
756 --source ndb_binlog_count_event_t1.inc
757
758 --echo And drop without dropping events...
759 set global debug='-d'; # Switch DEBUG/TRACING OFF
760 set global debug='+d,ndb_skip_drop_event';
761
762 drop table test.t1;
763 show warnings;
764
765 --echo Redo the drop command to clear MySQLD metadata
766 --echo Expect an error as the table doesn't exist in Ndb
767 --error 1051
768 drop table test.t1;
769 set global debug='+d'; # Switch DEBUG/TRACING ON
770 set global debug=@save_debug;
771
772 if ($SHOW_DETAIL)
773 {
774 --exec $NDB_SHOW_TABLES -t2
775 --exec echo Case 4 : Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
776 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
777 }
778 --echo Expecting 3 BLOB events for t1
779 --source ndb_binlog_count_event_t1.inc
780
781 --echo ----------------------------------------------------------------------
782 --echo Case 5 : Create a table with same name, different tableid, same blobs
783 --echo Expect : No errors, all blobs have events referring to their parts tables
784
785 --echo Create a filler table to shift-up tableids
786 create table test.filler1(a int) engine=ndb;
787
788 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
789 show warnings;
790
791 insert into test.t1 values(0, "b", "c", "d");
792
793 connection server1;
794 --disable_query_log
795 --disable_result_log
796 insert into test.synch values (null);
797 --enable_result_log
798 --enable_query_log
799
800 # Wait for epoch boundary
801 --disable_query_log
802 --disable_result_log
803 show binlog events;
804 --enable_result_log
805 --enable_query_log
806
807 --disable_query_log
808 let $MYSQLD_DATADIR= `select @@datadir;`;
809 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
810
811 create table raw_binlog_rows (txt varchar(1000));
812
813 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
814
815 --echo "Check that the binlog contains the inserted row"
816 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
817 drop table raw_binlog_rows;
818 --enable_query_log
819 reset master;
820
821 connection server2;
822 --disable_query_log
823 --disable_result_log
824 insert into test.synch values (null);
825 --enable_result_log
826 --enable_query_log
827
828 # Wait for epoch boundary
829 --disable_query_log
830 --disable_result_log
831 show binlog events;
832 --enable_result_log
833 --enable_query_log
834
835 --disable_query_log
836 let $MYSQLD_DATADIR= `select @@datadir;`;
837 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
838
839 create table raw_binlog_rows (txt varchar(1000));
840
841 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
842
843 --echo "Check that the binlog contains the inserted row"
844 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
845 drop table raw_binlog_rows;
846 --enable_query_log
847 reset master;
848
849 connection server1;
850
851 if ($SHOW_DETAIL)
852 {
853 --exec $NDB_SHOW_TABLES -t2
854 --exec echo Case 5 : Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
855 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
856 }
857 --echo Expecting 3 BLOB events for t1
858 --source ndb_binlog_count_event_t1.inc
859
860 --echo Drop table and recreate to get normal setup
861 --echo Expect : Table creates without warnings and all events are as expected
862 drop table test.t1;
863 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
864 show warnings;
865
866 insert into test.t1 values(0, "b", "c", "d");
867
868 connection server1;
869 --disable_query_log
870 --disable_result_log
871 insert into test.synch values (null);
872 --enable_result_log
873 --enable_query_log
874
875 # Wait for epoch boundary
876 --disable_query_log
877 --disable_result_log
878 show binlog events;
879 --enable_result_log
880 --enable_query_log
881
882 --disable_query_log
883 let $MYSQLD_DATADIR= `select @@datadir;`;
884 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
885
886 create table raw_binlog_rows (txt varchar(1000));
887
888 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
889
890 --echo "Check that the binlog contains the inserted row"
891 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
892 drop table raw_binlog_rows;
893 --enable_query_log
894 reset master;
895
896 connection server2;
897 --disable_query_log
898 --disable_result_log
899 insert into test.synch values (null);
900 --enable_result_log
901 --enable_query_log
902
903 # Wait for epoch boundary
904 --disable_query_log
905 --disable_result_log
906 show binlog events;
907 --enable_result_log
908 --enable_query_log
909
910 --disable_query_log
911 let $MYSQLD_DATADIR= `select @@datadir;`;
912 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
913
914 create table raw_binlog_rows (txt varchar(1000));
915
916 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
917
918 --echo "Check that the binlog contains the inserted row"
919 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
920 drop table raw_binlog_rows;
921 --enable_query_log
922 reset master;
923
924 connection server1;
925
926 if ($SHOW_DETAIL)
927 {
928 --exec $NDB_SHOW_TABLES -t2
929 --exec echo Case 5 : Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
930 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
931 }
932 --echo Expecting 3 BLOB events for t1
933 --source ndb_binlog_count_event_t1.inc
934
935 --echo And drop without dropping events...
936 set global debug='-d'; # Switch DEBUG/TRACING OFF
937 set global debug='+d,ndb_skip_drop_event';
938
939 drop table test.t1;
940 show warnings;
941
942 --echo Redo the drop command to clear MySQLD metadata
943 --echo Expect an error as the table doesn't exist in Ndb
944 --error 1051
945 drop table test.t1;
946 set global debug='+d'; # Switch DEBUG/TRACING ON
947 set global debug=@save_debug;
948
949 if ($SHOW_DETAIL)
950 {
951 --exec $NDB_SHOW_TABLES -t2
952 --exec echo Case 5 : Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
953 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
954 }
955 --echo Expecting 3 BLOB events for t1
956 --source ndb_binlog_count_event_t1.inc
957
958 --echo ----------------------------------------------------------------------
959 --echo Case 6 : Same name, different tableid, different numbered blobs
960 --echo Drop filler table to shift tableids
961 drop table test.filler1;
962
963 create table test.t1 (a int primary key, spacer int, b text, c text, d text) engine=ndb;
964 show warnings;
965
966 insert into test.t1 values(0, 1, "b", "c", "d");
967
968 connection server1;
969 --disable_query_log
970 --disable_result_log
971 insert into test.synch values (null);
972 --enable_result_log
973 --enable_query_log
974
975 # Wait for epoch boundary
976 --disable_query_log
977 --disable_result_log
978 show binlog events;
979 --enable_result_log
980 --enable_query_log
981
982 --disable_query_log
983 let $MYSQLD_DATADIR= `select @@datadir;`;
984 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
985
986 create table raw_binlog_rows (txt varchar(1000));
987
988 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
989
990 --echo "Check that the binlog contains the inserted row"
991 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
992 drop table raw_binlog_rows;
993 --enable_query_log
994 reset master;
995
996 connection server2;
997 --disable_query_log
998 --disable_result_log
999 insert into test.synch values (null);
1000 --enable_result_log
1001 --enable_query_log
1002
1003 # Wait for epoch boundary
1004 --disable_query_log
1005 --disable_result_log
1006 show binlog events;
1007 --enable_result_log
1008 --enable_query_log
1009
1010 --disable_query_log
1011 let $MYSQLD_DATADIR= `select @@datadir;`;
1012 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
1013
1014 create table raw_binlog_rows (txt varchar(1000));
1015
1016 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
1017
1018 --echo "Check that the binlog contains the inserted row"
1019 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
1020 drop table raw_binlog_rows;
1021 --enable_query_log
1022 reset master;
1023
1024 connection server1;
1025
1026 if ($SHOW_DETAIL)
1027 {
1028 --exec $NDB_SHOW_TABLES -t2
1029 --exec echo Case 6 : Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
1030 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
1031 }
1032 --echo Expecting 3 BLOB events for t1
1033 --source ndb_binlog_count_event_t1.inc
1034
1035 --echo And drop without dropping events...
1036 set global debug='-d'; # Switch DEBUG/TRACING OFF
1037 set global debug='+d,ndb_skip_drop_event';
1038
1039 drop table test.t1;
1040 show warnings;
1041
1042 --echo Redo the drop command to clear MySQLD metadata
1043 --echo Expect an error as the table doesn't exist in Ndb
1044 --error 1051
1045 drop table test.t1;
1046 set global debug='+d'; # Switch DEBUG/TRACING ON
1047 set global debug=@save_debug;
1048
1049 if ($SHOW_DETAIL)
1050 {
1051 --exec $NDB_SHOW_TABLES -t2
1052 --exec echo Case 5 : Expecting 3 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
1053 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
1054 }
1055 --echo Expecting 3 BLOB events for t1
1056 --source ndb_binlog_count_event_t1.inc
1057
1058 --echo ----------------------------------------------------------------------
1059 --echo Case 7 : Create a table with the same tableid + name, no blobs
1060 --echo Expect : No errors, all blob events gone, currently fail
1061
1062 create table test.t1 (a int primary key, b varchar(2), c varchar(2), d varchar(2), e varchar(2)) engine=ndb;
1063 show warnings;
1064
1065 insert into test.t1 values(0, "b", "c", "d", "e");
1066
1067 connection server1;
1068 --disable_query_log
1069 --disable_result_log
1070 insert into test.synch values (null);
1071 --enable_result_log
1072 --enable_query_log
1073
1074 # Wait for epoch boundary
1075 --disable_query_log
1076 --disable_result_log
1077 show binlog events;
1078 --enable_result_log
1079 --enable_query_log
1080
1081 --disable_query_log
1082 let $MYSQLD_DATADIR= `select @@datadir;`;
1083 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
1084
1085 create table raw_binlog_rows (txt varchar(1000));
1086
1087 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
1088
1089 --echo "Check that the binlog contains the inserted row"
1090 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
1091 drop table raw_binlog_rows;
1092 --enable_query_log
1093 reset master;
1094
1095 connection server2;
1096 --disable_query_log
1097 --disable_result_log
1098 insert into test.synch values (null);
1099 --enable_result_log
1100 --enable_query_log
1101
1102 # Wait for epoch boundary
1103 --disable_query_log
1104 --disable_result_log
1105 show binlog events;
1106 --enable_result_log
1107 --enable_query_log
1108
1109 --disable_query_log
1110 let $MYSQLD_DATADIR= `select @@datadir;`;
1111 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
1112
1113 create table raw_binlog_rows (txt varchar(1000));
1114
1115 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
1116
1117 --echo "Check that the binlog contains the inserted row"
1118 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
1119 drop table raw_binlog_rows;
1120 --enable_query_log
1121 reset master;
1122
1123 connection server1;
1124
1125 if ($SHOW_DETAIL)
1126 {
1127 --exec $NDB_SHOW_TABLES -t2
1128 --exec echo Case 7 : Expecting 0 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
1129 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
1130 }
1131 --echo Expecting 0 BLOB events for t1 (TODO clean up BLOB events always)
1132 --source ndb_binlog_count_event_t1.inc
1133
1134 --echo Drop the table, but fail to drop any event(s)
1135 set global debug='-d'; # Switch DEBUG/TRACING OFF
1136 set global debug='+d,ndb_skip_drop_event';
1137
1138 drop table test.t1;
1139 show warnings;
1140
1141 --echo Redo the drop command to clear MySQLD metadata
1142 --echo Expect an error as the table doesn't exist in Ndb
1143 --error 1051
1144 drop table test.t1;
1145 set global debug='+d'; # Switch DEBUG/TRACING ON
1146 set global debug=@save_debug;
1147
1148 if ($SHOW_DETAIL)
1149 {
1150 --exec $NDB_SHOW_TABLES -t2
1151 --exec echo Case 7 : Expecting 0 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
1152 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
1153 }
1154 --echo Expecting 0 BLOB events for t1 (TODO clean up BLOB events always)
1155 --source ndb_binlog_count_event_t1.inc
1156
1157 --echo ----------------------------------------------------------------------
1158 --echo Case 8 : Create a table with the same tableid + name, blobs when previously no blobs
1159 --echo Expect : No errors, event setup includes one event for each blob column
1160
1161 create table test.t1 (a int primary key, b text, c text, d text, e text) engine=ndb;
1162 show warnings;
1163
1164 insert into test.t1 values(0, "b", "c", "d", "e");
1165
1166 connection server1;
1167 --disable_query_log
1168 --disable_result_log
1169 insert into test.synch values (null);
1170 --enable_result_log
1171 --enable_query_log
1172
1173 # Wait for epoch boundary
1174 --disable_query_log
1175 --disable_result_log
1176 show binlog events;
1177 --enable_result_log
1178 --enable_query_log
1179
1180 --disable_query_log
1181 let $MYSQLD_DATADIR= `select @@datadir;`;
1182 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
1183
1184 create table raw_binlog_rows (txt varchar(1000));
1185
1186 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
1187
1188 --echo "Check that the binlog contains the inserted row"
1189 select distinct "mysqld1:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
1190 drop table raw_binlog_rows;
1191 --enable_query_log
1192 reset master;
1193
1194 connection server2;
1195 --disable_query_log
1196 --disable_result_log
1197 insert into test.synch values (null);
1198 --enable_result_log
1199 --enable_query_log
1200
1201 # Wait for epoch boundary
1202 --disable_query_log
1203 --disable_result_log
1204 show binlog events;
1205 --enable_result_log
1206 --enable_query_log
1207
1208 --disable_query_log
1209 let $MYSQLD_DATADIR= `select @@datadir;`;
1210 --exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
1211
1212 create table raw_binlog_rows (txt varchar(1000));
1213
1214 --eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
1215
1216 --echo "Check that the binlog contains the inserted row"
1217 select distinct "mysqld2:",txt from raw_binlog_rows where txt like "### % `test`.`t1`" or txt like "### %='b'" or txt like "### %='c'" or txt like "### %='d'" or txt like "### %='e'";
1218 drop table raw_binlog_rows;
1219 --enable_query_log
1220 reset master;
1221
1222 connection server1;
1223
1224 if ($SHOW_DETAIL)
1225 {
1226 --exec $NDB_SHOW_TABLES -t2
1227 --exec echo Case 8 : Expecting 4 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
1228 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
1229 }
1230 --echo Expecting 4 BLOB events for t1
1231 --source ndb_binlog_count_event_t1.inc
1232
1233 # Cases :
1234 # 1: Same name
1235 # 2: Same name, same tableid, more blobs
1236 # 3: Same name, same tableid, fewer blobs
1237 # 4: Same name, same tableid, different numbered blobs
1238 # 5: Same name, different tableid, same blobs
1239 # 6: Same name, different tableid, different numbered blobs
1240 # 7: Same name, same tableid, no blobs when previously blobs
1241 # 8: Same name, same tableid, blobs when previously no blobs
1242
1243
1244 # Weird 'reuse existing event with name x'
1245 # Missing blob event
1246
1247 drop table test.t1;
1248
1249 if ($SHOW_DETAIL)
1250 {
1251 --exec $NDB_SHOW_TABLES -t2
1252 --exec echo Expecting 0 BLOB events for t1 >> $MYSQLTEST_VARDIR/tmp.dat
1253 --exec $NDB_SELECT_ALL -dsys NDB\$EVENTS_0
1254 }
1255 --echo Expecting 0 BLOB events for t1
1256 --source ndb_binlog_count_event_t1.inc
1257
1258 drop table test.synch;
1259 --remove_file $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
1260 --remove_file $MYSQLTEST_VARDIR/tmp.dat