Debian Codegraph @

mysql-test/suite/ndb_binlog/r/ndb_binlog_event_clean.result

raw
1 # We are using some debug-only features in this test
2 Explore some event weirdness
3 use test;
4 create table test.synch(x int primary key auto_increment) engine=ndb;
5 show create table test.synch;
6 reset master;
7 Create table with tableId X and blob part tables :
8 NDB$BLOB_X_2
9 NDB$BLOB_X_3
10 NDB$BLOB_X_4
11 Event will also be created
12 REPL$test/t1
13 Plus
14 NDB$BLOBEVENT_REPL$test/t1_2
15 NDB$BLOBEVENT_REPL$test/t1_3
16 NDB$BLOBEVENT_REPL$test/t1_4
17 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
18 insert into test.t1 values(0, "b", "c", "d");
19 "Check that the binlog contains the inserted row"
20 mysqld1: txt
21 mysqld1: ### INSERT INTO `test`.`t1`
22 mysqld1: ### @2='b'
23 mysqld1: ### @3='c'
24 mysqld1: ### @4='d'
25 reset master;
26 "Check that the binlog contains the inserted row"
27 mysqld2: txt
28 mysqld2: ### INSERT INTO `test`.`t1`
29 mysqld2: ### @2='b'
30 mysqld2: ### @3='c'
31 mysqld2: ### @4='d'
32 reset master;
33 Show tables and events
34 Expecting 3 BLOB events for t1
35 select count(*) from raw_binlog_events where txt like '%t1\_%';
36 count(*)
37 3
38 Drop table, and show tables and events gone
39 drop table test.t1;
40 Expecting 0 BLOB events for t1
41 select count(*) from raw_binlog_events where txt like '%t1\_%';
42 count(*)
43 0
44 Recreate the table
45 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
46 insert into test.t1 values(0, "b", "c", "d");
47 "Check that the binlog contains the inserted row"
48 mysqld1: txt
49 mysqld1: ### INSERT INTO `test`.`t1`
50 mysqld1: ### @2='b'
51 mysqld1: ### @3='c'
52 mysqld1: ### @4='d'
53 reset master;
54 "Check that the binlog contains the inserted row"
55 mysqld2: txt
56 mysqld2: ### INSERT INTO `test`.`t1`
57 mysqld2: ### @2='b'
58 mysqld2: ### @3='c'
59 mysqld2: ### @4='d'
60 reset master;
61 Expecting 3 BLOB events for t1
62 select count(*) from raw_binlog_events where txt like '%t1\_%';
63 count(*)
64 3
65 Drop the table, but fail to drop the event(s)
66 set @save_debug = @@global.debug;
67 set global debug='-d';
68 set global debug='+d,ndb_skip_drop_event';
69 drop table test.t1;
70 show warnings;
71 Level Code Message
72 Expect : The tables are gone, but their events still hang around
73 Expecting 3 BLOB events for t1
74 select count(*) from raw_binlog_events where txt like '%t1\_%';
75 count(*)
76 3
77 Redo the drop command to clear MySQLD metadata
78 Expect an error as the table doesn't exist in Ndb
79 drop table test.t1;
80 ERROR 42S02: Unknown table 'test.t1'
81 set global debug='+d';
82 set global debug=@save_debug;
83 Expect : The tables are gone, but their events still hang around
84 Expecting 3 BLOB events for t1
85 select count(*) from raw_binlog_events where txt like '%t1\_%';
86 count(*)
87 3
88 ----------------------------------------------------------------------
89 Case 1 : Create a table with the same tableId and same number of blobs
90 Expect : Creation ok with no errors
91 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
92 show warnings;
93 Level Code Message
94 insert into test.t1 values(0, "b", "c", "d");
95 "Check that the binlog contains the inserted row"
96 mysqld1: txt
97 mysqld1: ### INSERT INTO `test`.`t1`
98 mysqld1: ### @2='b'
99 mysqld1: ### @3='c'
100 mysqld1: ### @4='d'
101 reset master;
102 "Check that the binlog contains the inserted row"
103 mysqld2: txt
104 mysqld2: ### INSERT INTO `test`.`t1`
105 mysqld2: ### @2='b'
106 mysqld2: ### @3='c'
107 mysqld2: ### @4='d'
108 reset master;
109 Expecting 3 BLOB events for t1
110 select count(*) from raw_binlog_events where txt like '%t1\_%';
111 count(*)
112 3
113 Drop the table, but fail to drop the event(s)
114 set global debug='-d';
115 set global debug='+d,ndb_skip_drop_event';
116 drop table test.t1;
117 show warnings;
118 Level Code Message
119 Redo the drop command to clear MySQLD metadata
120 Expect an error as the table doesn't exist in Ndb
121 drop table test.t1;
122 ERROR 42S02: Unknown table 'test.t1'
123 set global debug='+d';
124 set global debug=@save_debug;
125 Expecting 3 BLOB events for t1
126 select count(*) from raw_binlog_events where txt like '%t1\_%';
127 count(*)
128 3
129 ----------------------------------------------------------------------
130 Case 2 : Create a table with the same tableid + name, more blobs
131 Expect : No errors, event setup includes one event for each blob column
132 create table test.t1 (a int primary key, b text, c text, d text, e text) engine=ndb;
133 show warnings;
134 Level Code Message
135 insert into test.t1 values(0, "b", "c", "d", "e");
136 "Check that the binlog contains the inserted row"
137 mysqld1: txt
138 mysqld1: ### INSERT INTO `test`.`t1`
139 mysqld1: ### @2='b'
140 mysqld1: ### @3='c'
141 mysqld1: ### @4='d'
142 mysqld1: ### @5='e'
143 reset master;
144 "Check that the binlog contains the inserted row"
145 mysqld2: txt
146 mysqld2: ### INSERT INTO `test`.`t1`
147 mysqld2: ### @2='b'
148 mysqld2: ### @3='c'
149 mysqld2: ### @4='d'
150 mysqld2: ### @5='e'
151 reset master;
152 Expecting 4 BLOB events for t1
153 select count(*) from raw_binlog_events where txt like '%t1\_%';
154 count(*)
155 4
156 Drop the table, but fail to drop the event(s)
157 set global debug='-d';
158 set global debug='+d,ndb_skip_drop_event';
159 drop table test.t1;
160 show warnings;
161 Level Code Message
162 Redo the drop command to clear MySQLD metadata
163 Expect an error as the table doesn't exist in Ndb
164 drop table test.t1;
165 ERROR 42S02: Unknown table 'test.t1'
166 set global debug='+d';
167 set global debug=@save_debug;
168 Expecting 4 BLOB events for t1
169 select count(*) from raw_binlog_events where txt like '%t1\_%';
170 count(*)
171 4
172 ----------------------------------------------------------------------
173 Case 3 : Create a table with the same tableid + name, fewer blobs
174 Expect : No errors, extra blob events dropped
175 create table test.t1 (a int primary key, b text) engine=ndb;
176 show warnings;
177 Level Code Message
178 insert into test.t1 values(0, "b");
179 "Check that the binlog contains the inserted row"
180 mysqld1: txt
181 mysqld1: ### INSERT INTO `test`.`t1`
182 mysqld1: ### @2='b'
183 reset master;
184 "Check that the binlog contains the inserted row"
185 mysqld2: txt
186 mysqld2: ### INSERT INTO `test`.`t1`
187 mysqld2: ### @2='b'
188 reset master;
189 Expecting 1 BLOB events for t1
190 select count(*) from raw_binlog_events where txt like '%t1\_%';
191 count(*)
192 1
193 Drop the table, but fail to drop the event(s)
194 set global debug='-d';
195 set global debug='+d,ndb_skip_drop_event';
196 drop table test.t1;
197 show warnings;
198 Level Code Message
199 Redo the drop command to clear MySQLD metadata
200 Expect an error as the table doesn't exist in Ndb
201 drop table test.t1;
202 ERROR 42S02: Unknown table 'test.t1'
203 set global debug='+d';
204 set global debug=@save_debug;
205 Expecting 1 BLOB events for t1
206 select count(*) from raw_binlog_events where txt like '%t1\_%';
207 count(*)
208 1
209 ----------------------------------------------------------------------
210 Case 4 : Create a table with the same tableid + name, different numbered blobs
211 Expect : No errors, event for new numbered blob, others gone
212 create table test.t1 (a int primary key, b int, c text) engine=ndb;
213 show warnings;
214 Level Code Message
215 insert into test.t1 values(0, 1, "c");
216 "Check that the binlog contains the inserted row"
217 mysqld1: txt
218 mysqld1: ### INSERT INTO `test`.`t1`
219 mysqld1: ### @3='c'
220 reset master;
221 "Check that the binlog contains the inserted row"
222 mysqld2: txt
223 mysqld2: ### INSERT INTO `test`.`t1`
224 mysqld2: ### @3='c'
225 reset master;
226 Expecting 1 BLOB events for t1
227 select count(*) from raw_binlog_events where txt like '%t1\_%';
228 count(*)
229 1
230 Drop the table, but fail to drop the event(s)
231 set global debug='-d';
232 set global debug='+d,ndb_skip_drop_event';
233 drop table test.t1;
234 show warnings;
235 Level Code Message
236 Redo the drop command to clear MySQLD metadata
237 Expect an error as the table doesn't exist in Ndb
238 drop table test.t1;
239 ERROR 42S02: Unknown table 'test.t1'
240 set global debug='+d';
241 set global debug=@save_debug;
242 Cleanup table in cluster
243 Expect : All t1 related events and tables gone
244 create table test.t1 (a int primary key, b text) engine=ndb;
245 insert into test.t1 values(0, "b");
246 "Check that the binlog contains the inserted row"
247 mysqld1: txt
248 mysqld1: ### INSERT INTO `test`.`t1`
249 mysqld1: ### @2='b'
250 reset master;
251 "Check that the binlog contains the inserted row"
252 mysqld2: txt
253 mysqld2: ### INSERT INTO `test`.`t1`
254 mysqld2: ### @2='b'
255 reset master;
256 drop table test.t1;
257 Expecting 0 BLOB events for t1
258 select count(*) from raw_binlog_events where txt like '%t1\_%';
259 count(*)
260 0
261 Create table with 3 blob columns
262 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
263 insert into test.t1 values(0, "b", "c", "d");
264 "Check that the binlog contains the inserted row"
265 mysqld1: txt
266 mysqld1: ### INSERT INTO `test`.`t1`
267 mysqld1: ### @2='b'
268 mysqld1: ### @3='c'
269 mysqld1: ### @4='d'
270 reset master;
271 "Check that the binlog contains the inserted row"
272 mysqld2: txt
273 mysqld2: ### INSERT INTO `test`.`t1`
274 mysqld2: ### @2='b'
275 mysqld2: ### @3='c'
276 mysqld2: ### @4='d'
277 reset master;
278 Expecting 3 BLOB events for t1
279 select count(*) from raw_binlog_events where txt like '%t1\_%';
280 count(*)
281 3
282 And drop without dropping events...
283 set global debug='-d';
284 set global debug='+d,ndb_skip_drop_event';
285 drop table test.t1;
286 show warnings;
287 Level Code Message
288 Redo the drop command to clear MySQLD metadata
289 Expect an error as the table doesn't exist in Ndb
290 drop table test.t1;
291 ERROR 42S02: Unknown table 'test.t1'
292 set global debug='+d';
293 set global debug=@save_debug;
294 Expecting 3 BLOB events for t1
295 select count(*) from raw_binlog_events where txt like '%t1\_%';
296 count(*)
297 3
298 ----------------------------------------------------------------------
299 Case 5 : Create a table with same name, different tableid, same blobs
300 Expect : No errors, all blobs have events referring to their parts tables
301 Create a filler table to shift-up tableids
302 create table test.filler1(a int) engine=ndb;
303 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
304 show warnings;
305 Level Code Message
306 insert into test.t1 values(0, "b", "c", "d");
307 "Check that the binlog contains the inserted row"
308 mysqld1: txt
309 mysqld1: ### INSERT INTO `test`.`t1`
310 mysqld1: ### @2='b'
311 mysqld1: ### @3='c'
312 mysqld1: ### @4='d'
313 reset master;
314 "Check that the binlog contains the inserted row"
315 mysqld2: txt
316 mysqld2: ### INSERT INTO `test`.`t1`
317 mysqld2: ### @2='b'
318 mysqld2: ### @3='c'
319 mysqld2: ### @4='d'
320 reset master;
321 Expecting 3 BLOB events for t1
322 select count(*) from raw_binlog_events where txt like '%t1\_%';
323 count(*)
324 3
325 Drop table and recreate to get normal setup
326 Expect : Table creates without warnings and all events are as expected
327 drop table test.t1;
328 create table test.t1 (a int primary key, b text, c text, d text) engine=ndb;
329 show warnings;
330 Level Code Message
331 insert into test.t1 values(0, "b", "c", "d");
332 "Check that the binlog contains the inserted row"
333 mysqld1: txt
334 mysqld1: ### INSERT INTO `test`.`t1`
335 mysqld1: ### @2='b'
336 mysqld1: ### @3='c'
337 mysqld1: ### @4='d'
338 reset master;
339 "Check that the binlog contains the inserted row"
340 mysqld2: txt
341 mysqld2: ### INSERT INTO `test`.`t1`
342 mysqld2: ### @2='b'
343 mysqld2: ### @3='c'
344 mysqld2: ### @4='d'
345 reset master;
346 Expecting 3 BLOB events for t1
347 select count(*) from raw_binlog_events where txt like '%t1\_%';
348 count(*)
349 3
350 And drop without dropping events...
351 set global debug='-d';
352 set global debug='+d,ndb_skip_drop_event';
353 drop table test.t1;
354 show warnings;
355 Level Code Message
356 Redo the drop command to clear MySQLD metadata
357 Expect an error as the table doesn't exist in Ndb
358 drop table test.t1;
359 ERROR 42S02: Unknown table 'test.t1'
360 set global debug='+d';
361 set global debug=@save_debug;
362 Expecting 3 BLOB events for t1
363 select count(*) from raw_binlog_events where txt like '%t1\_%';
364 count(*)
365 3
366 ----------------------------------------------------------------------
367 Case 6 : Same name, different tableid, different numbered blobs
368 Drop filler table to shift tableids
369 drop table test.filler1;
370 create table test.t1 (a int primary key, spacer int, b text, c text, d text) engine=ndb;
371 show warnings;
372 Level Code Message
373 insert into test.t1 values(0, 1, "b", "c", "d");
374 "Check that the binlog contains the inserted row"
375 mysqld1: txt
376 mysqld1: ### INSERT INTO `test`.`t1`
377 mysqld1: ### @3='b'
378 mysqld1: ### @4='c'
379 mysqld1: ### @5='d'
380 reset master;
381 "Check that the binlog contains the inserted row"
382 mysqld2: txt
383 mysqld2: ### INSERT INTO `test`.`t1`
384 mysqld2: ### @3='b'
385 mysqld2: ### @4='c'
386 mysqld2: ### @5='d'
387 reset master;
388 Expecting 3 BLOB events for t1
389 select count(*) from raw_binlog_events where txt like '%t1\_%';
390 count(*)
391 3
392 And drop without dropping events...
393 set global debug='-d';
394 set global debug='+d,ndb_skip_drop_event';
395 drop table test.t1;
396 show warnings;
397 Level Code Message
398 Redo the drop command to clear MySQLD metadata
399 Expect an error as the table doesn't exist in Ndb
400 drop table test.t1;
401 ERROR 42S02: Unknown table 'test.t1'
402 set global debug='+d';
403 set global debug=@save_debug;
404 Expecting 3 BLOB events for t1
405 select count(*) from raw_binlog_events where txt like '%t1\_%';
406 count(*)
407 3
408 ----------------------------------------------------------------------
409 Case 7 : Create a table with the same tableid + name, no blobs
410 Expect : No errors, all blob events gone, currently fail
411 create table test.t1 (a int primary key, b varchar(2), c varchar(2), d varchar(2), e varchar(2)) engine=ndb;
412 show warnings;
413 Level Code Message
414 insert into test.t1 values(0, "b", "c", "d", "e");
415 "Check that the binlog contains the inserted row"
416 mysqld1: txt
417 mysqld1: ### INSERT INTO `test`.`t1`
418 mysqld1: ### @2='b'
419 mysqld1: ### @3='c'
420 mysqld1: ### @4='d'
421 mysqld1: ### @5='e'
422 reset master;
423 "Check that the binlog contains the inserted row"
424 mysqld2: txt
425 mysqld2: ### INSERT INTO `test`.`t1`
426 mysqld2: ### @2='b'
427 mysqld2: ### @3='c'
428 mysqld2: ### @4='d'
429 mysqld2: ### @5='e'
430 reset master;
431 Expecting 0 BLOB events for t1 (TODO clean up BLOB events always)
432 select count(*) from raw_binlog_events where txt like '%t1\_%';
433 count(*)
434 3
435 Drop the table, but fail to drop any event(s)
436 set global debug='-d';
437 set global debug='+d,ndb_skip_drop_event';
438 drop table test.t1;
439 show warnings;
440 Level Code Message
441 Redo the drop command to clear MySQLD metadata
442 Expect an error as the table doesn't exist in Ndb
443 drop table test.t1;
444 ERROR 42S02: Unknown table 'test.t1'
445 set global debug='+d';
446 set global debug=@save_debug;
447 Expecting 0 BLOB events for t1 (TODO clean up BLOB events always)
448 select count(*) from raw_binlog_events where txt like '%t1\_%';
449 count(*)
450 3
451 ----------------------------------------------------------------------
452 Case 8 : Create a table with the same tableid + name, blobs when previously no blobs
453 Expect : No errors, event setup includes one event for each blob column
454 create table test.t1 (a int primary key, b text, c text, d text, e text) engine=ndb;
455 show warnings;
456 Level Code Message
457 insert into test.t1 values(0, "b", "c", "d", "e");
458 "Check that the binlog contains the inserted row"
459 mysqld1: txt
460 mysqld1: ### INSERT INTO `test`.`t1`
461 mysqld1: ### @2='b'
462 mysqld1: ### @3='c'
463 mysqld1: ### @4='d'
464 mysqld1: ### @5='e'
465 reset master;
466 "Check that the binlog contains the inserted row"
467 mysqld2: txt
468 mysqld2: ### INSERT INTO `test`.`t1`
469 mysqld2: ### @2='b'
470 mysqld2: ### @3='c'
471 mysqld2: ### @4='d'
472 mysqld2: ### @5='e'
473 reset master;
474 Expecting 4 BLOB events for t1
475 select count(*) from raw_binlog_events where txt like '%t1\_%';
476 count(*)
477 4
478 drop table test.t1;
479 Expecting 0 BLOB events for t1
480 select count(*) from raw_binlog_events where txt like '%t1\_%';
481 count(*)
482 0
483 drop table test.synch;