summaryrefslogtreecommitdiff
path: root/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
blob: 39d18b7403d899b90dc14de9b9131c0856d52b43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
################################################################################
# In this test case, we verify if some DDL statements implicitly commit a 
# transaction and are written directly to the binary log without going
# through either the Statement- or Transactional-Cache. 
#
# As any statement that goes through a cache is written to the binary log
# wrapped in a BEGIN...COMMIT, we proceed as follows:  
#
#  - create a transaction and insert some values into a transactional table.
#  - execute a DDL statement that is supposed to implicitly commit the previous
#  transaction. 
#  - Check in the binary log for a COMMIT mark which is supposed to be written
#  before the DDL statement.
#  - Check in the binary log if the DDL is not wrapped by a BEGIN..COMMIT. 
#
# For further details, please, read WL#2687 and WL#5072.
################################################################################

--echo #########################################################################
--echo #                            CONFIGURATION
--echo #########################################################################
connection master;

eval CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = $engine;
eval CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = $engine;
eval CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam;

INSERT INTO tt_1(ddl_case) VALUES(0);
INSERT INTO tt_2(ddl_case) VALUES(0);

--echo #########################################################################
--echo #                          CHECK IMPLICT COMMIT
--echo #########################################################################
SET AUTOCOMMIT= 0;
let $ddl_cases= 41;
while (`SELECT $ddl_cases >= 1`)
{
  --echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
  let $in_temporary= "no";
  let $ok= "yes";
  #
  # In SBR and MIXED modes, the commit event is usually the third event in the
  # binary log:
  #
  # 1: BEGIN
  # 2: INSERT
  # 3: COMMIT
  # 4: DDL EVENT which triggered the previous commmit.
  #
  if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
  {
    let $commit_event_row_number= 3;
  }
  #
  # In RBR mode, the commit event is usually the fourth event in the binary log:
  #
  # 1: BEGIN
  # 2: TABLE MAP EVENT
  # 3: ROW EVENT
  # 4: COMMIT
  # 5: DDL EVENT which triggered the previous commmit.
  #
  if (`select @@binlog_format = 'ROW'`)
  {
    let $commit_event_row_number= 4;
  }
  #
  # In NDB (RBR and MIXED modes), the commit event is usually the seventh event
  # in the binary log:
  #
  # 1: COMMAND
  # 2: BEGIN
  # 3: TABLE MAP EVENT
  # 4: TABLE MAP EVENT (ndb_apply_status)
  # 5: ROW EVENT
  # 6: ROW EVENT
  # 7: COMMIT
  #
  if (`select '$engine' = 'NDB'`)
  {
    let $commit_event_row_number= 7;
  }
  
  let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1);
  --enable_query_log
  eval INSERT INTO tt_1(ddl_case) VALUES ($ddl_cases);
  if (`SELECT $ddl_cases = 41`)
  {
    let $cmd= LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES;
    if (`SELECT '$engine' = 'NDB'`)
    {
      # This seems to be related to epochs.
      # We need to check this against an updated version or avoid it.
      let $ok= "no";
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 40`)
  {
    let $cmd= LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES;
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 39`)
  {
    let $cmd= ANALYZE TABLE nt_1;
  }
  if (`SELECT $ddl_cases = 38`)
  {
    let $cmd= CHECK TABLE nt_1;
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 37`)
  {
    let $cmd= OPTIMIZE TABLE nt_1;
  }
  if (`SELECT $ddl_cases = 36`)
  {
    let $cmd= REPAIR TABLE nt_1;
  }
  if (`SELECT $ddl_cases = 35`)
  {
    let $cmd= LOCK TABLES tt_1 WRITE;
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 34`)
  {
    let $cmd= UNLOCK TABLES;
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 33`)
  {
    let $cmd= CREATE USER 'user'@'localhost';
  }
  if (`SELECT $ddl_cases = 32`)
  {
    let $cmd= GRANT ALL ON *.* TO 'user'@'localhost';
  }
  if (`SELECT $ddl_cases = 31`)
  {
    let $cmd= SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass');
    #
    # In NDB (RBR mode), the commit event is the eleventh event
    # in the binary log:
    #
    # 1: DDL EVENT which triggered the previous commmit.
    # 2: BEGIN
    # 3: TABLE MAP EVENT
    # 4: ROW EVENT
    # 5: COMMIT
    # 6: BEGIN
    # 7: TABLE MAP EVENT
    # 8: TABLE MAP EVENT (ndb_apply_status)
    # 9: ROW EVENT
    # 10: ROW EVENT
    # 11: COMMIT
    #
    if (`SELECT '$engine' = 'NDB' && @@binlog_format = 'ROW'`)
    {
      let $commit_event_row_number= 11;
    }
    #
    # In NDB (MIXED mode), the commit event is the eighth event
    # in the binary log:
    #
    # 1: DDL EVENT which triggered the previous commmit.
    # 2: COMMIT
    # 3: BEGIN
    # 4: TABLE MAP EVENT
    # 5: TABLE MAP EVENT (ndb_apply_status)
    # 6: ROW EVENT
    # 7: ROW EVENT
    # 8: COMMIT
    #
    if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'`)
    {
      let $commit_event_row_number= 7;
    }
  }
  if (`SELECT $ddl_cases = 30`)
  {
    let $cmd= REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost';
  }
  if (`SELECT $ddl_cases = 29`)
  {
    let $cmd= RENAME USER 'user'@'localhost' TO 'user_new'@'localhost';
  }
  if (`SELECT $ddl_cases = 28`)
  {
    let $cmd= DROP USER 'user_new'@'localhost';
  }
  if (`SELECT $ddl_cases = 27`)
  {
    let $cmd= CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
  }
  if (`SELECT $ddl_cases = 26`)
  {
    let $cmd= ALTER EVENT evt COMMENT 'evt';
  }
  if (`SELECT $ddl_cases = 25`)
  {
    let $cmd= DROP EVENT evt;
  }
  if (`SELECT $ddl_cases = 24`)
  {
    let $cmd= CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
  }
  if (`SELECT $ddl_cases = 23`)
  {
    let $cmd= DROP TRIGGER tr;
    #
    # In RBR mode, due to the trigger the tt_2 is also updated:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT
    # 4: ROW EVENT
    # 5: COMMIT
    # 6: DDL EVENT which triggered the previous commmit.
    #
    if (`select @@binlog_format = 'ROW' && '$engine' != 'NDB'`)
    {
      let $commit_event_row_number= 5;
    }
  }
  if (`SELECT $ddl_cases = 22`)
  {
    let $cmd= CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc";
  }
  if (`SELECT $ddl_cases = 21`)
  {
    let $cmd= ALTER FUNCTION fc COMMENT 'fc';
  }
  if (`SELECT $ddl_cases = 20`)
  {
    let $cmd= DROP FUNCTION fc;
  }
  if (`SELECT $ddl_cases = 19`)
  {
    let $cmd= CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
  }
  if (`SELECT $ddl_cases = 18`)
  {
    let $cmd= ALTER PROCEDURE pc COMMENT 'pc';
  }
  if (`SELECT $ddl_cases = 17`)
  {
    let $cmd= DROP PROCEDURE pc;
  }
  if (`SELECT $ddl_cases = 16`)
  {
    let $cmd= CREATE VIEW v AS SELECT * FROM tt_1;
  }
  if (`SELECT $ddl_cases = 15`)
  {
    let $cmd= ALTER VIEW v AS SELECT * FROM tt_1;
  }
  if (`SELECT $ddl_cases = 14`)
  {
    let $cmd= DROP VIEW v;
  }
  if (`SELECT $ddl_cases = 13`)
  {
    let $cmd= CREATE INDEX ix ON tt_1(ddl_case);
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    # 7: DDL EVENT which triggered the previous commmit.
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 12`)
  {
    let $cmd= DROP INDEX ix ON tt_1;
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    # 7: DDL EVENT which triggered the previous commmit.
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 11`)
  {
    let $cmd= CREATE TEMPORARY TABLE tt_xx (a int);
    let $in_temporary= "yes";
    # In SBR and MIXED modes, the DDL statement is written to the binary log but
    # does not commit the current transaction.
    #
    # 1: BEGIN
    # 2: INSERT
    # 3: CREATE TEMPORARY
    #
    # In RBR the transaction is not committed either and the statement is not
    # written to the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: ROW EVENT
    #
    if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
    {
      let $commit_event_row_number= 4;
    }
    #
    # In NDB (RBR mode), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    #
    if (`SELECT '$engine' = 'NDB' && @@binlog_format = 'ROW'` )
    {
      let $commit_event_row_number= 6;
    }
    #
    # In NDB (MIXED mode), the commit event is the nineth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: DDL EVENT which triggered the previous commmit.
    # 3: COMMIT
    # 4: BEGIN
    # 5: TABLE MAP EVENT
    # 6: TABLE MAP EVENT (ndb_apply_status)
    # 7: ROW EVENT
    # 8: ROW EVENT
    # 9: COMMIT
    #
    if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'` )
    {
      let $commit_event_row_number= 9;
    }
  }
  if (`SELECT $ddl_cases = 10`)
  {
    let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int);
    #
    # In MIXED mode, the changes are logged as rows and we have what follows:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: ROW EVENT
    # 4: COMMIT
    # 5: DDL EVENT which triggered the previous commmit.
    #
    if (`select @@binlog_format = 'MIXED'`)
    {
      let $commit_event_row_number= 4;
    }
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 9`)
  {
    let $cmd= ALTER TABLE tt_xx RENAME new_tt_xx;
    #
    # In MIXED mode, the changes are logged as rows and we have what follows:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: ROW EVENT
    # 4: COMMIT
    # 5: DDL EVENT which triggered the previous commmit.
    #
    if (`select @@binlog_format = 'MIXED'`)
    {
      let $commit_event_row_number= 4;
    }
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 8`)
  {
    let $cmd= DROP TEMPORARY TABLE IF EXISTS new_tt_xx;
    let $in_temporary= "yes";
    #
    # In SBR and MIXED modes, the DDL statement is written to the binary log
    # but does not commit the current transaction:
    #
    # 1: BEGIN
    # 2: INSERT
    # 3: DROP TEMPORARY
    #
    # In RBR the transaction is not committed either and the statement is not
    # written to the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: ROW EVENT
    #
    if (`select @@binlog_format = 'STATEMENT'`)
    {
      let $commit_event_row_number= 4;
    }
    # In MIXED mode, the changes are logged as rows and we have what follows:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: ROW EVENT
    # 4: DROP TEMPORARY table IF EXISTS
    #
    if (`select @@binlog_format = 'MIXED'`)
    {
      let $commit_event_row_number= 5;
    }
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
    #
    # In NDB (MIXED mode), the commit event is the nineth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: DDL EVENT which triggered the previous commmit.
    # 3: COMMIT
    # 4: BEGIN
    # 5: TABLE MAP EVENT
    # 6: TABLE MAP EVENT (ndb_apply_status)
    # 7: ROW EVENT
    # 8: ROW EVENT
    # 9: COMMIT
    #
    if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'` )
    {
      let $commit_event_row_number= 9;
    }
  }
  if (`SELECT $ddl_cases = 7`)
  {
    let $cmd= CREATE TABLE tt_xx (a int);
  }
  if (`SELECT $ddl_cases = 6`)
  {
    let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int);
  }
  if (`SELECT $ddl_cases = 5`)
  {
    let $cmd= RENAME TABLE tt_xx TO new_tt_xx;
  }
  if (`SELECT $ddl_cases = 4`)
  {
    let $cmd= TRUNCATE TABLE new_tt_xx;
  }
  if (`SELECT $ddl_cases = 3`)
  {
    let $cmd= DROP TABLE IF EXISTS tt_xx, new_tt_xx;
  }
  if (`SELECT $ddl_cases = 2`)
  {
    let $cmd= CREATE DATABASE db;
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    # 7: DDL EVENT which triggered the previous commmit.
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  if (`SELECT $ddl_cases = 1`)
  {
    let $cmd= DROP DATABASE IF EXISTS db;
    #
    # In NDB (RBR and MIXED modes), the commit event is the sixth event
    # in the binary log:
    #
    # 1: BEGIN
    # 2: TABLE MAP EVENT
    # 3: TABLE MAP EVENT (ndb_apply_status)
    # 4: ROW EVENT
    # 5: ROW EVENT
    # 6: COMMIT
    # 7: DDL EVENT which triggered the previous commmit.
    #
    if (`SELECT '$engine' = 'NDB'`)
    {
      let $commit_event_row_number= 6;
    }
  }
  --eval $cmd
  --disable_query_log
  #
  # When a temporary table is either created or dropped, there is no implicit
  # commit. The flag in_temporary is used to avoid aborting the test in such
  # cases. Thus we force the commit.
  #
  if (`SELECT $in_temporary = "yes"`)
  {
    --eval COMMIT
  }
  let $event_commit= query_get_value("SHOW BINLOG EVENTS FROM $first_binlog_position", Info, $commit_event_row_number);
  if (`SELECT SUBSTRING("$event_commit",1,6) != "COMMIT"`)
  {
    if (`SELECT $ok = "yes"`)
    {
      --echo it *does not* commit the current transaction.
      --echo $cmd
      --echo $event_commit
      SHOW BINLOG EVENTS;
      exit;
    }
  }
  --echo -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
  let $binlog_start= $first_binlog_position;
  --echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
  --source include/show_binlog_events.inc
  --echo -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
  --echo
  dec $ddl_cases;
}
SET AUTOCOMMIT= 1;

--echo ###################################################################################
--echo #                               CHECK CONSISTENCY
--echo ###################################################################################
--sync_slave_with_master

--let $diff_table_1= master:test.tt_1
--let $diff_table_2= slave:test.tt_1
--source include/diff_tables.inc

--echo ###################################################################################
--echo #                                        CLEAN
--echo ###################################################################################
connection master;

DROP TABLE tt_1;
DROP TABLE tt_2;
DROP TABLE nt_1;

sync_slave_with_master;