~vkolesnikov/pbxt/pbxt-2.0-24.06.2011

« back to all changes in this revision

Viewing changes to test/mysql-test/test_data/505/r/rpl_ndb_ddl.result

  • Committer: vladimir at primebase
  • Date: 2011-06-24 12:11:14 UTC
  • mfrom: (831.2.95 pbxt15)
  • Revision ID: vladimir@primebase.org-20110624121114-s8hwmwjch3baec75
merged changes from PBXT 1.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
stop slave;
 
2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
3
reset master;
 
4
reset slave;
 
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
6
start slave;
 
7
SET AUTOCOMMIT = 1;
 
8
DROP DATABASE IF EXISTS mysqltest1;
 
9
DROP DATABASE IF EXISTS mysqltest2;
 
10
DROP DATABASE IF EXISTS mysqltest3;
 
11
CREATE DATABASE mysqltest1;
 
12
CREATE DATABASE mysqltest2;
 
13
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="NDB";
 
14
INSERT INTO mysqltest1.t1 SET f1= 0;
 
15
CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE="NDB";
 
16
CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE="NDB";
 
17
CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE="NDB";
 
18
CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE="NDB";
 
19
CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE="NDB";
 
20
CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
 
21
CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE="NDB";
 
22
INSERT INTO mysqltest1.t7 SET f1= 0;
 
23
CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE="NDB";
 
24
CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE="NDB";
 
25
CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE="NDB";
 
26
CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE="NDB";
 
27
CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE="NDB";
 
28
CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE="NDB";
 
29
CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE="NDB";
 
30
CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE="NDB";
 
31
CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE="NDB";
 
32
CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE="NDB";
 
33
CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE="NDB";
 
34
CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE="NDB";
 
35
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT);
 
36
SET AUTOCOMMIT = 0;
 
37
use mysqltest1;
 
38
 
 
39
-------- switch to slave --------
 
40
SET AUTOCOMMIT = 0;
 
41
use mysqltest1;
 
42
 
 
43
-------- switch to master -------
 
44
 
 
45
######## COMMIT  ########
 
46
 
 
47
-------- switch to master -------
 
48
INSERT INTO t1 SET f1= 0 + 1;
 
49
SELECT MAX(f1) FROM t1;
 
50
MAX(f1)
 
51
1
 
52
 
 
53
-------- switch to slave --------
 
54
SELECT MAX(f1) FROM t1;
 
55
MAX(f1)
 
56
0
 
57
 
 
58
-------- switch to master -------
 
59
COMMIT;
 
60
SELECT MAX(f1) FROM t1;
 
61
MAX(f1)
 
62
1
 
63
 
 
64
-------- switch to slave --------
 
65
SELECT MAX(f1) FROM t1;
 
66
MAX(f1)
 
67
1
 
68
 
 
69
-------- switch to master -------
 
70
ROLLBACK;
 
71
SELECT MAX(f1) FROM t1;
 
72
MAX(f1)
 
73
1
 
74
 
 
75
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
76
 
 
77
-------- switch to slave --------
 
78
SELECT MAX(f1) FROM t1;
 
79
MAX(f1)
 
80
1
 
81
 
 
82
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
83
 
 
84
-------- switch to master -------
 
85
flush logs;
 
86
 
 
87
-------- switch to slave --------
 
88
flush logs;
 
89
 
 
90
-------- switch to master -------
 
91
 
 
92
######## ROLLBACK  ########
 
93
 
 
94
-------- switch to master -------
 
95
INSERT INTO t1 SET f1= 1 + 1;
 
96
SELECT MAX(f1) FROM t1;
 
97
MAX(f1)
 
98
2
 
99
 
 
100
-------- switch to slave --------
 
101
SELECT MAX(f1) FROM t1;
 
102
MAX(f1)
 
103
1
 
104
 
 
105
-------- switch to master -------
 
106
ROLLBACK;
 
107
SELECT MAX(f1) FROM t1;
 
108
MAX(f1)
 
109
1
 
110
 
 
111
-------- switch to slave --------
 
112
SELECT MAX(f1) FROM t1;
 
113
MAX(f1)
 
114
1
 
115
 
 
116
-------- switch to master -------
 
117
ROLLBACK;
 
118
SELECT MAX(f1) FROM t1;
 
119
MAX(f1)
 
120
1
 
121
 
 
122
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
 
123
 
 
124
-------- switch to slave --------
 
125
SELECT MAX(f1) FROM t1;
 
126
MAX(f1)
 
127
1
 
128
 
 
129
TEST-INFO: SLAVE:  The INSERT is not committed (Succeeded)
 
130
 
 
131
-------- switch to master -------
 
132
flush logs;
 
133
 
 
134
-------- switch to slave --------
 
135
flush logs;
 
136
 
 
137
-------- switch to master -------
 
138
 
 
139
######## SET AUTOCOMMIT=1  ########
 
140
 
 
141
-------- switch to master -------
 
142
INSERT INTO t1 SET f1= 1 + 1;
 
143
SELECT MAX(f1) FROM t1;
 
144
MAX(f1)
 
145
2
 
146
 
 
147
-------- switch to slave --------
 
148
SELECT MAX(f1) FROM t1;
 
149
MAX(f1)
 
150
1
 
151
 
 
152
-------- switch to master -------
 
153
SET AUTOCOMMIT=1;
 
154
SELECT MAX(f1) FROM t1;
 
155
MAX(f1)
 
156
2
 
157
 
 
158
-------- switch to slave --------
 
159
SELECT MAX(f1) FROM t1;
 
160
MAX(f1)
 
161
2
 
162
 
 
163
-------- switch to master -------
 
164
ROLLBACK;
 
165
SELECT MAX(f1) FROM t1;
 
166
MAX(f1)
 
167
2
 
168
 
 
169
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
170
 
 
171
-------- switch to slave --------
 
172
SELECT MAX(f1) FROM t1;
 
173
MAX(f1)
 
174
2
 
175
 
 
176
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
177
 
 
178
-------- switch to master -------
 
179
flush logs;
 
180
 
 
181
-------- switch to slave --------
 
182
flush logs;
 
183
 
 
184
-------- switch to master -------
 
185
SET AUTOCOMMIT=0;
 
186
 
 
187
######## START TRANSACTION  ########
 
188
 
 
189
-------- switch to master -------
 
190
INSERT INTO t1 SET f1= 2 + 1;
 
191
SELECT MAX(f1) FROM t1;
 
192
MAX(f1)
 
193
3
 
194
 
 
195
-------- switch to slave --------
 
196
SELECT MAX(f1) FROM t1;
 
197
MAX(f1)
 
198
2
 
199
 
 
200
-------- switch to master -------
 
201
START TRANSACTION;
 
202
SELECT MAX(f1) FROM t1;
 
203
MAX(f1)
 
204
3
 
205
 
 
206
-------- switch to slave --------
 
207
SELECT MAX(f1) FROM t1;
 
208
MAX(f1)
 
209
3
 
210
 
 
211
-------- switch to master -------
 
212
ROLLBACK;
 
213
SELECT MAX(f1) FROM t1;
 
214
MAX(f1)
 
215
3
 
216
 
 
217
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
218
 
 
219
-------- switch to slave --------
 
220
SELECT MAX(f1) FROM t1;
 
221
MAX(f1)
 
222
3
 
223
 
 
224
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
225
 
 
226
-------- switch to master -------
 
227
flush logs;
 
228
 
 
229
-------- switch to slave --------
 
230
flush logs;
 
231
 
 
232
-------- switch to master -------
 
233
 
 
234
######## BEGIN  ########
 
235
 
 
236
-------- switch to master -------
 
237
INSERT INTO t1 SET f1= 3 + 1;
 
238
SELECT MAX(f1) FROM t1;
 
239
MAX(f1)
 
240
4
 
241
 
 
242
-------- switch to slave --------
 
243
SELECT MAX(f1) FROM t1;
 
244
MAX(f1)
 
245
3
 
246
 
 
247
-------- switch to master -------
 
248
BEGIN;
 
249
SELECT MAX(f1) FROM t1;
 
250
MAX(f1)
 
251
4
 
252
 
 
253
-------- switch to slave --------
 
254
SELECT MAX(f1) FROM t1;
 
255
MAX(f1)
 
256
4
 
257
 
 
258
-------- switch to master -------
 
259
ROLLBACK;
 
260
SELECT MAX(f1) FROM t1;
 
261
MAX(f1)
 
262
4
 
263
 
 
264
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
265
 
 
266
-------- switch to slave --------
 
267
SELECT MAX(f1) FROM t1;
 
268
MAX(f1)
 
269
4
 
270
 
 
271
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
272
 
 
273
-------- switch to master -------
 
274
flush logs;
 
275
 
 
276
-------- switch to slave --------
 
277
flush logs;
 
278
 
 
279
-------- switch to master -------
 
280
 
 
281
######## DROP TABLE mysqltest1.t2  ########
 
282
 
 
283
-------- switch to master -------
 
284
INSERT INTO t1 SET f1= 4 + 1;
 
285
SELECT MAX(f1) FROM t1;
 
286
MAX(f1)
 
287
5
 
288
 
 
289
-------- switch to slave --------
 
290
SELECT MAX(f1) FROM t1;
 
291
MAX(f1)
 
292
4
 
293
 
 
294
-------- switch to master -------
 
295
DROP TABLE mysqltest1.t2;
 
296
SELECT MAX(f1) FROM t1;
 
297
MAX(f1)
 
298
5
 
299
 
 
300
-------- switch to slave --------
 
301
SELECT MAX(f1) FROM t1;
 
302
MAX(f1)
 
303
5
 
304
 
 
305
-------- switch to master -------
 
306
ROLLBACK;
 
307
SELECT MAX(f1) FROM t1;
 
308
MAX(f1)
 
309
5
 
310
 
 
311
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
312
 
 
313
-------- switch to slave --------
 
314
SELECT MAX(f1) FROM t1;
 
315
MAX(f1)
 
316
5
 
317
 
 
318
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
319
 
 
320
-------- switch to master -------
 
321
flush logs;
 
322
 
 
323
-------- switch to slave --------
 
324
flush logs;
 
325
 
 
326
-------- switch to master -------
 
327
SHOW TABLES LIKE 't2';
 
328
Tables_in_mysqltest1 (t2)
 
329
 
 
330
-------- switch to slave --------
 
331
SHOW TABLES LIKE 't2';
 
332
Tables_in_mysqltest1 (t2)
 
333
 
 
334
-------- switch to master -------
 
335
 
 
336
######## DROP TEMPORARY TABLE mysqltest1.t23  ########
 
337
 
 
338
-------- switch to master -------
 
339
INSERT INTO t1 SET f1= 5 + 1;
 
340
SELECT MAX(f1) FROM t1;
 
341
MAX(f1)
 
342
6
 
343
 
 
344
-------- switch to slave --------
 
345
SELECT MAX(f1) FROM t1;
 
346
MAX(f1)
 
347
5
 
348
 
 
349
-------- switch to master -------
 
350
DROP TEMPORARY TABLE mysqltest1.t23;
 
351
SELECT MAX(f1) FROM t1;
 
352
MAX(f1)
 
353
6
 
354
 
 
355
-------- switch to slave --------
 
356
SELECT MAX(f1) FROM t1;
 
357
MAX(f1)
 
358
5
 
359
 
 
360
-------- switch to master -------
 
361
ROLLBACK;
 
362
SELECT MAX(f1) FROM t1;
 
363
MAX(f1)
 
364
5
 
365
 
 
366
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
 
367
 
 
368
-------- switch to slave --------
 
369
SELECT MAX(f1) FROM t1;
 
370
MAX(f1)
 
371
5
 
372
 
 
373
TEST-INFO: SLAVE:  The INSERT is not committed (Succeeded)
 
374
 
 
375
-------- switch to master -------
 
376
flush logs;
 
377
 
 
378
-------- switch to slave --------
 
379
flush logs;
 
380
 
 
381
-------- switch to master -------
 
382
SHOW TABLES LIKE 't23';
 
383
Tables_in_mysqltest1 (t23)
 
384
 
 
385
-------- switch to slave --------
 
386
SHOW TABLES LIKE 't23';
 
387
Tables_in_mysqltest1 (t23)
 
388
 
 
389
-------- switch to master -------
 
390
 
 
391
######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20  ########
 
392
 
 
393
-------- switch to master -------
 
394
INSERT INTO t1 SET f1= 5 + 1;
 
395
SELECT MAX(f1) FROM t1;
 
396
MAX(f1)
 
397
6
 
398
 
 
399
-------- switch to slave --------
 
400
SELECT MAX(f1) FROM t1;
 
401
MAX(f1)
 
402
5
 
403
 
 
404
-------- switch to master -------
 
405
RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
 
406
SELECT MAX(f1) FROM t1;
 
407
MAX(f1)
 
408
6
 
409
 
 
410
-------- switch to slave --------
 
411
SELECT MAX(f1) FROM t1;
 
412
MAX(f1)
 
413
6
 
414
 
 
415
-------- switch to master -------
 
416
ROLLBACK;
 
417
SELECT MAX(f1) FROM t1;
 
418
MAX(f1)
 
419
6
 
420
 
 
421
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
422
 
 
423
-------- switch to slave --------
 
424
SELECT MAX(f1) FROM t1;
 
425
MAX(f1)
 
426
6
 
427
 
 
428
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
429
 
 
430
-------- switch to master -------
 
431
flush logs;
 
432
 
 
433
-------- switch to slave --------
 
434
flush logs;
 
435
 
 
436
-------- switch to master -------
 
437
SHOW TABLES LIKE 't20';
 
438
Tables_in_mysqltest1 (t20)
 
439
t20
 
440
 
 
441
-------- switch to slave --------
 
442
SHOW TABLES LIKE 't20';
 
443
Tables_in_mysqltest1 (t20)
 
444
t20
 
445
 
 
446
-------- switch to master -------
 
447
 
 
448
######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT  ########
 
449
 
 
450
-------- switch to master -------
 
451
INSERT INTO t1 SET f1= 6 + 1;
 
452
SELECT MAX(f1) FROM t1;
 
453
MAX(f1)
 
454
7
 
455
 
 
456
-------- switch to slave --------
 
457
SELECT MAX(f1) FROM t1;
 
458
MAX(f1)
 
459
6
 
460
 
 
461
-------- switch to master -------
 
462
ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
 
463
SELECT MAX(f1) FROM t1;
 
464
MAX(f1)
 
465
7
 
466
 
 
467
-------- switch to slave --------
 
468
SELECT MAX(f1) FROM t1;
 
469
MAX(f1)
 
470
7
 
471
 
 
472
-------- switch to master -------
 
473
ROLLBACK;
 
474
SELECT MAX(f1) FROM t1;
 
475
MAX(f1)
 
476
7
 
477
 
 
478
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
479
 
 
480
-------- switch to slave --------
 
481
SELECT MAX(f1) FROM t1;
 
482
MAX(f1)
 
483
7
 
484
 
 
485
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
486
 
 
487
-------- switch to master -------
 
488
flush logs;
 
489
 
 
490
-------- switch to slave --------
 
491
flush logs;
 
492
 
 
493
-------- switch to master -------
 
494
describe mysqltest1.t4;
 
495
Field   Type    Null    Key     Default Extra
 
496
f1      bigint(20)      YES             NULL    
 
497
f2      bigint(20)      YES             NULL    
 
498
 
 
499
-------- switch to slave --------
 
500
describe mysqltest1.t4;
 
501
Field   Type    Null    Key     Default Extra
 
502
f1      bigint(20)      YES             NULL    
 
503
f2      bigint(20)      YES             NULL    
 
504
 
 
505
-------- switch to master -------
 
506
 
 
507
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB"  ########
 
508
 
 
509
-------- switch to master -------
 
510
INSERT INTO t1 SET f1= 7 + 1;
 
511
SELECT MAX(f1) FROM t1;
 
512
MAX(f1)
 
513
8
 
514
 
 
515
-------- switch to slave --------
 
516
SELECT MAX(f1) FROM t1;
 
517
MAX(f1)
 
518
7
 
519
 
 
520
-------- switch to master -------
 
521
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB";
 
522
SELECT MAX(f1) FROM t1;
 
523
MAX(f1)
 
524
8
 
525
 
 
526
-------- switch to slave --------
 
527
SELECT MAX(f1) FROM t1;
 
528
MAX(f1)
 
529
8
 
530
 
 
531
-------- switch to master -------
 
532
ROLLBACK;
 
533
SELECT MAX(f1) FROM t1;
 
534
MAX(f1)
 
535
8
 
536
 
 
537
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
538
 
 
539
-------- switch to slave --------
 
540
SELECT MAX(f1) FROM t1;
 
541
MAX(f1)
 
542
8
 
543
 
 
544
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
545
 
 
546
-------- switch to master -------
 
547
flush logs;
 
548
 
 
549
-------- switch to slave --------
 
550
flush logs;
 
551
 
 
552
-------- switch to master -------
 
553
 
 
554
######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT)  ########
 
555
 
 
556
-------- switch to master -------
 
557
INSERT INTO t1 SET f1= 8 + 1;
 
558
SELECT MAX(f1) FROM t1;
 
559
MAX(f1)
 
560
9
 
561
 
 
562
-------- switch to slave --------
 
563
SELECT MAX(f1) FROM t1;
 
564
MAX(f1)
 
565
8
 
566
 
 
567
-------- switch to master -------
 
568
CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT);
 
569
SELECT MAX(f1) FROM t1;
 
570
MAX(f1)
 
571
9
 
572
 
 
573
-------- switch to slave --------
 
574
SELECT MAX(f1) FROM t1;
 
575
MAX(f1)
 
576
8
 
577
 
 
578
-------- switch to master -------
 
579
ROLLBACK;
 
580
SELECT MAX(f1) FROM t1;
 
581
MAX(f1)
 
582
8
 
583
 
 
584
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
 
585
 
 
586
-------- switch to slave --------
 
587
SELECT MAX(f1) FROM t1;
 
588
MAX(f1)
 
589
8
 
590
 
 
591
TEST-INFO: SLAVE:  The INSERT is not committed (Succeeded)
 
592
 
 
593
-------- switch to master -------
 
594
flush logs;
 
595
 
 
596
-------- switch to slave --------
 
597
flush logs;
 
598
 
 
599
-------- switch to master -------
 
600
 
 
601
######## TRUNCATE TABLE mysqltest1.t7  ########
 
602
 
 
603
-------- switch to master -------
 
604
INSERT INTO t1 SET f1= 8 + 1;
 
605
SELECT MAX(f1) FROM t1;
 
606
MAX(f1)
 
607
9
 
608
 
 
609
-------- switch to slave --------
 
610
SELECT MAX(f1) FROM t1;
 
611
MAX(f1)
 
612
8
 
613
 
 
614
-------- switch to master -------
 
615
TRUNCATE TABLE mysqltest1.t7;
 
616
SELECT MAX(f1) FROM t1;
 
617
MAX(f1)
 
618
9
 
619
 
 
620
-------- switch to slave --------
 
621
SELECT MAX(f1) FROM t1;
 
622
MAX(f1)
 
623
9
 
624
 
 
625
-------- switch to master -------
 
626
ROLLBACK;
 
627
SELECT MAX(f1) FROM t1;
 
628
MAX(f1)
 
629
9
 
630
 
 
631
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
632
 
 
633
-------- switch to slave --------
 
634
SELECT MAX(f1) FROM t1;
 
635
MAX(f1)
 
636
9
 
637
 
 
638
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
639
 
 
640
-------- switch to master -------
 
641
flush logs;
 
642
 
 
643
-------- switch to slave --------
 
644
flush logs;
 
645
 
 
646
-------- switch to master -------
 
647
SELECT * FROM mysqltest1.t7;
 
648
f1
 
649
-------- switch to slave --------
 
650
SELECT * FROM mysqltest1.t7;
 
651
f1
 
652
-------- switch to master -------
 
653
 
 
654
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ  ########
 
655
 
 
656
-------- switch to master -------
 
657
INSERT INTO t1 SET f1= 9 + 1;
 
658
SELECT MAX(f1) FROM t1;
 
659
MAX(f1)
 
660
10
 
661
 
 
662
-------- switch to slave --------
 
663
SELECT MAX(f1) FROM t1;
 
664
MAX(f1)
 
665
9
 
666
 
 
667
-------- switch to master -------
 
668
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
 
669
SELECT MAX(f1) FROM t1;
 
670
MAX(f1)
 
671
10
 
672
 
 
673
-------- switch to slave --------
 
674
SELECT MAX(f1) FROM t1;
 
675
MAX(f1)
 
676
10
 
677
 
 
678
-------- switch to master -------
 
679
ROLLBACK;
 
680
SELECT MAX(f1) FROM t1;
 
681
MAX(f1)
 
682
10
 
683
 
 
684
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
685
 
 
686
-------- switch to slave --------
 
687
SELECT MAX(f1) FROM t1;
 
688
MAX(f1)
 
689
10
 
690
 
 
691
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
692
 
 
693
-------- switch to master -------
 
694
flush logs;
 
695
 
 
696
-------- switch to slave --------
 
697
flush logs;
 
698
 
 
699
-------- switch to master -------
 
700
UNLOCK TABLES;
 
701
 
 
702
######## UNLOCK TABLES  ########
 
703
 
 
704
-------- switch to master -------
 
705
INSERT INTO t1 SET f1= 10 + 1;
 
706
SELECT MAX(f1) FROM t1;
 
707
MAX(f1)
 
708
11
 
709
 
 
710
-------- switch to slave --------
 
711
SELECT MAX(f1) FROM t1;
 
712
MAX(f1)
 
713
10
 
714
 
 
715
-------- switch to master -------
 
716
UNLOCK TABLES;
 
717
SELECT MAX(f1) FROM t1;
 
718
MAX(f1)
 
719
11
 
720
 
 
721
-------- switch to slave --------
 
722
SELECT MAX(f1) FROM t1;
 
723
MAX(f1)
 
724
10
 
725
 
 
726
-------- switch to master -------
 
727
ROLLBACK;
 
728
SELECT MAX(f1) FROM t1;
 
729
MAX(f1)
 
730
10
 
731
 
 
732
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
 
733
 
 
734
-------- switch to slave --------
 
735
SELECT MAX(f1) FROM t1;
 
736
MAX(f1)
 
737
10
 
738
 
 
739
TEST-INFO: SLAVE:  The INSERT is not committed (Succeeded)
 
740
 
 
741
-------- switch to master -------
 
742
flush logs;
 
743
 
 
744
-------- switch to slave --------
 
745
flush logs;
 
746
 
 
747
-------- switch to master -------
 
748
LOCK TABLES mysqltest1.t1 READ;
 
749
 
 
750
######## UNLOCK TABLES  ########
 
751
 
 
752
-------- switch to master -------
 
753
INSERT INTO t1 SET f1= 10 + 1;
 
754
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
 
755
SELECT MAX(f1) FROM t1;
 
756
MAX(f1)
 
757
10
 
758
 
 
759
-------- switch to slave --------
 
760
SELECT MAX(f1) FROM t1;
 
761
MAX(f1)
 
762
10
 
763
 
 
764
-------- switch to master -------
 
765
UNLOCK TABLES;
 
766
SELECT MAX(f1) FROM t1;
 
767
MAX(f1)
 
768
10
 
769
 
 
770
-------- switch to slave --------
 
771
SELECT MAX(f1) FROM t1;
 
772
MAX(f1)
 
773
10
 
774
 
 
775
-------- switch to master -------
 
776
ROLLBACK;
 
777
SELECT MAX(f1) FROM t1;
 
778
MAX(f1)
 
779
10
 
780
 
 
781
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
 
782
 
 
783
-------- switch to slave --------
 
784
SELECT MAX(f1) FROM t1;
 
785
MAX(f1)
 
786
10
 
787
 
 
788
TEST-INFO: SLAVE:  The INSERT is not committed (Succeeded)
 
789
 
 
790
-------- switch to master -------
 
791
flush logs;
 
792
 
 
793
-------- switch to slave --------
 
794
flush logs;
 
795
 
 
796
-------- switch to master -------
 
797
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
 
798
 
 
799
######## UNLOCK TABLES  ########
 
800
 
 
801
-------- switch to master -------
 
802
INSERT INTO t1 SET f1= 10 + 1;
 
803
SELECT MAX(f1) FROM t1;
 
804
MAX(f1)
 
805
11
 
806
 
 
807
-------- switch to slave --------
 
808
SELECT MAX(f1) FROM t1;
 
809
MAX(f1)
 
810
10
 
811
 
 
812
-------- switch to master -------
 
813
UNLOCK TABLES;
 
814
SELECT MAX(f1) FROM t1;
 
815
MAX(f1)
 
816
11
 
817
 
 
818
-------- switch to slave --------
 
819
SELECT MAX(f1) FROM t1;
 
820
MAX(f1)
 
821
11
 
822
 
 
823
-------- switch to master -------
 
824
ROLLBACK;
 
825
SELECT MAX(f1) FROM t1;
 
826
MAX(f1)
 
827
11
 
828
 
 
829
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
830
 
 
831
-------- switch to slave --------
 
832
SELECT MAX(f1) FROM t1;
 
833
MAX(f1)
 
834
11
 
835
 
 
836
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
837
 
 
838
-------- switch to master -------
 
839
flush logs;
 
840
 
 
841
-------- switch to slave --------
 
842
flush logs;
 
843
 
 
844
-------- switch to master -------
 
845
 
 
846
######## DROP INDEX my_idx6 ON mysqltest1.t6  ########
 
847
 
 
848
-------- switch to master -------
 
849
INSERT INTO t1 SET f1= 11 + 1;
 
850
SELECT MAX(f1) FROM t1;
 
851
MAX(f1)
 
852
12
 
853
 
 
854
-------- switch to slave --------
 
855
SELECT MAX(f1) FROM t1;
 
856
MAX(f1)
 
857
11
 
858
 
 
859
-------- switch to master -------
 
860
DROP INDEX my_idx6 ON mysqltest1.t6;
 
861
SELECT MAX(f1) FROM t1;
 
862
MAX(f1)
 
863
12
 
864
 
 
865
-------- switch to slave --------
 
866
SELECT MAX(f1) FROM t1;
 
867
MAX(f1)
 
868
12
 
869
 
 
870
-------- switch to master -------
 
871
ROLLBACK;
 
872
SELECT MAX(f1) FROM t1;
 
873
MAX(f1)
 
874
12
 
875
 
 
876
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
877
 
 
878
-------- switch to slave --------
 
879
SELECT MAX(f1) FROM t1;
 
880
MAX(f1)
 
881
12
 
882
 
 
883
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
884
 
 
885
-------- switch to master -------
 
886
flush logs;
 
887
 
 
888
-------- switch to slave --------
 
889
flush logs;
 
890
 
 
891
-------- switch to master -------
 
892
SHOW INDEX FROM mysqltest1.t6;
 
893
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment
 
894
 
 
895
-------- switch to slave --------
 
896
SHOW INDEX FROM mysqltest1.t6;
 
897
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment
 
898
 
 
899
-------- switch to master -------
 
900
 
 
901
######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1)  ########
 
902
 
 
903
-------- switch to master -------
 
904
INSERT INTO t1 SET f1= 12 + 1;
 
905
SELECT MAX(f1) FROM t1;
 
906
MAX(f1)
 
907
13
 
908
 
 
909
-------- switch to slave --------
 
910
SELECT MAX(f1) FROM t1;
 
911
MAX(f1)
 
912
12
 
913
 
 
914
-------- switch to master -------
 
915
CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
 
916
SELECT MAX(f1) FROM t1;
 
917
MAX(f1)
 
918
13
 
919
 
 
920
-------- switch to slave --------
 
921
SELECT MAX(f1) FROM t1;
 
922
MAX(f1)
 
923
13
 
924
 
 
925
-------- switch to master -------
 
926
ROLLBACK;
 
927
SELECT MAX(f1) FROM t1;
 
928
MAX(f1)
 
929
13
 
930
 
 
931
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
932
 
 
933
-------- switch to slave --------
 
934
SELECT MAX(f1) FROM t1;
 
935
MAX(f1)
 
936
13
 
937
 
 
938
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
939
 
 
940
-------- switch to master -------
 
941
flush logs;
 
942
 
 
943
-------- switch to slave --------
 
944
flush logs;
 
945
 
 
946
-------- switch to master -------
 
947
SHOW INDEX FROM mysqltest1.t5;
 
948
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment
 
949
t5      1       my_idx5 1       f1      A       0       NULL    NULL    YES     BTREE   
 
950
 
 
951
-------- switch to slave --------
 
952
SHOW INDEX FROM mysqltest1.t5;
 
953
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment
 
954
t5      1       my_idx5 1       f1      A       0       NULL    NULL    YES     BTREE   
 
955
 
 
956
-------- switch to master -------
 
957
 
 
958
######## DROP DATABASE mysqltest2  ########
 
959
 
 
960
-------- switch to master -------
 
961
INSERT INTO t1 SET f1= 13 + 1;
 
962
SELECT MAX(f1) FROM t1;
 
963
MAX(f1)
 
964
14
 
965
 
 
966
-------- switch to slave --------
 
967
SELECT MAX(f1) FROM t1;
 
968
MAX(f1)
 
969
13
 
970
 
 
971
-------- switch to master -------
 
972
DROP DATABASE mysqltest2;
 
973
SELECT MAX(f1) FROM t1;
 
974
MAX(f1)
 
975
14
 
976
 
 
977
-------- switch to slave --------
 
978
SELECT MAX(f1) FROM t1;
 
979
MAX(f1)
 
980
14
 
981
 
 
982
-------- switch to master -------
 
983
ROLLBACK;
 
984
SELECT MAX(f1) FROM t1;
 
985
MAX(f1)
 
986
14
 
987
 
 
988
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
989
 
 
990
-------- switch to slave --------
 
991
SELECT MAX(f1) FROM t1;
 
992
MAX(f1)
 
993
14
 
994
 
 
995
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
996
 
 
997
-------- switch to master -------
 
998
flush logs;
 
999
 
 
1000
-------- switch to slave --------
 
1001
flush logs;
 
1002
 
 
1003
-------- switch to master -------
 
1004
SHOW DATABASES LIKE "mysqltest2";
 
1005
Database (mysqltest2)
 
1006
 
 
1007
-------- switch to slave --------
 
1008
SHOW DATABASES LIKE "mysqltest2";
 
1009
Database (mysqltest2)
 
1010
 
 
1011
-------- switch to master -------
 
1012
 
 
1013
######## CREATE DATABASE mysqltest3  ########
 
1014
 
 
1015
-------- switch to master -------
 
1016
INSERT INTO t1 SET f1= 14 + 1;
 
1017
SELECT MAX(f1) FROM t1;
 
1018
MAX(f1)
 
1019
15
 
1020
 
 
1021
-------- switch to slave --------
 
1022
SELECT MAX(f1) FROM t1;
 
1023
MAX(f1)
 
1024
14
 
1025
 
 
1026
-------- switch to master -------
 
1027
CREATE DATABASE mysqltest3;
 
1028
SELECT MAX(f1) FROM t1;
 
1029
MAX(f1)
 
1030
15
 
1031
 
 
1032
-------- switch to slave --------
 
1033
SELECT MAX(f1) FROM t1;
 
1034
MAX(f1)
 
1035
15
 
1036
 
 
1037
-------- switch to master -------
 
1038
ROLLBACK;
 
1039
SELECT MAX(f1) FROM t1;
 
1040
MAX(f1)
 
1041
15
 
1042
 
 
1043
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1044
 
 
1045
-------- switch to slave --------
 
1046
SELECT MAX(f1) FROM t1;
 
1047
MAX(f1)
 
1048
15
 
1049
 
 
1050
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1051
 
 
1052
-------- switch to master -------
 
1053
flush logs;
 
1054
 
 
1055
-------- switch to slave --------
 
1056
flush logs;
 
1057
 
 
1058
-------- switch to master -------
 
1059
SHOW DATABASES LIKE "mysqltest3";
 
1060
Database (mysqltest3)
 
1061
mysqltest3
 
1062
 
 
1063
-------- switch to slave --------
 
1064
SHOW DATABASES LIKE "mysqltest3";
 
1065
Database (mysqltest3)
 
1066
mysqltest3
 
1067
 
 
1068
-------- switch to master -------
 
1069
 
 
1070
######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1"  ########
 
1071
 
 
1072
-------- switch to master -------
 
1073
INSERT INTO t1 SET f1= 15 + 1;
 
1074
SELECT MAX(f1) FROM t1;
 
1075
MAX(f1)
 
1076
16
 
1077
 
 
1078
-------- switch to slave --------
 
1079
SELECT MAX(f1) FROM t1;
 
1080
MAX(f1)
 
1081
15
 
1082
 
 
1083
-------- switch to master -------
 
1084
CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
 
1085
SELECT MAX(f1) FROM t1;
 
1086
MAX(f1)
 
1087
16
 
1088
 
 
1089
-------- switch to slave --------
 
1090
SELECT MAX(f1) FROM t1;
 
1091
MAX(f1)
 
1092
16
 
1093
 
 
1094
-------- switch to master -------
 
1095
ROLLBACK;
 
1096
SELECT MAX(f1) FROM t1;
 
1097
MAX(f1)
 
1098
16
 
1099
 
 
1100
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1101
 
 
1102
-------- switch to slave --------
 
1103
SELECT MAX(f1) FROM t1;
 
1104
MAX(f1)
 
1105
16
 
1106
 
 
1107
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1108
 
 
1109
-------- switch to master -------
 
1110
flush logs;
 
1111
 
 
1112
-------- switch to slave --------
 
1113
flush logs;
 
1114
 
 
1115
-------- switch to master -------
 
1116
SHOW PROCEDURE STATUS LIKE 'p1';
 
1117
Db      mysqltest1
 
1118
Name    p1
 
1119
Type    PROCEDURE
 
1120
Definer root@localhost
 
1121
Modified        #
 
1122
Created #
 
1123
Security_type   DEFINER
 
1124
Comment 
 
1125
        -------- switch to slave -------
 
1126
SHOW PROCEDURE STATUS LIKE 'p1';
 
1127
Db      mysqltest1
 
1128
Name    p1
 
1129
Type    PROCEDURE
 
1130
Definer root@localhost
 
1131
Modified        #
 
1132
Created #
 
1133
Security_type   DEFINER
 
1134
Comment 
 
1135
 
 
1136
######## ALTER PROCEDURE p1 COMMENT "I have been altered"  ########
 
1137
 
 
1138
-------- switch to master -------
 
1139
INSERT INTO t1 SET f1= 16 + 1;
 
1140
SELECT MAX(f1) FROM t1;
 
1141
MAX(f1)
 
1142
17
 
1143
 
 
1144
-------- switch to slave --------
 
1145
SELECT MAX(f1) FROM t1;
 
1146
MAX(f1)
 
1147
16
 
1148
 
 
1149
-------- switch to master -------
 
1150
ALTER PROCEDURE p1 COMMENT "I have been altered";
 
1151
SELECT MAX(f1) FROM t1;
 
1152
MAX(f1)
 
1153
17
 
1154
 
 
1155
-------- switch to slave --------
 
1156
SELECT MAX(f1) FROM t1;
 
1157
MAX(f1)
 
1158
17
 
1159
 
 
1160
-------- switch to master -------
 
1161
ROLLBACK;
 
1162
SELECT MAX(f1) FROM t1;
 
1163
MAX(f1)
 
1164
17
 
1165
 
 
1166
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1167
 
 
1168
-------- switch to slave --------
 
1169
SELECT MAX(f1) FROM t1;
 
1170
MAX(f1)
 
1171
17
 
1172
 
 
1173
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1174
 
 
1175
-------- switch to master -------
 
1176
flush logs;
 
1177
 
 
1178
-------- switch to slave --------
 
1179
flush logs;
 
1180
 
 
1181
-------- switch to master -------
 
1182
SHOW PROCEDURE STATUS LIKE 'p1';
 
1183
Db      mysqltest1
 
1184
Name    p1
 
1185
Type    PROCEDURE
 
1186
Definer root@localhost
 
1187
Modified        #
 
1188
Created #
 
1189
Security_type   DEFINER
 
1190
Comment I have been altered
 
1191
        -------- switch to slave -------
 
1192
SHOW PROCEDURE STATUS LIKE 'p1';
 
1193
Db      mysqltest1
 
1194
Name    p1
 
1195
Type    PROCEDURE
 
1196
Definer root@localhost
 
1197
Modified        #
 
1198
Created #
 
1199
Security_type   DEFINER
 
1200
Comment I have been altered
 
1201
 
 
1202
######## DROP PROCEDURE p1  ########
 
1203
 
 
1204
-------- switch to master -------
 
1205
INSERT INTO t1 SET f1= 17 + 1;
 
1206
SELECT MAX(f1) FROM t1;
 
1207
MAX(f1)
 
1208
18
 
1209
 
 
1210
-------- switch to slave --------
 
1211
SELECT MAX(f1) FROM t1;
 
1212
MAX(f1)
 
1213
17
 
1214
 
 
1215
-------- switch to master -------
 
1216
DROP PROCEDURE p1;
 
1217
SELECT MAX(f1) FROM t1;
 
1218
MAX(f1)
 
1219
18
 
1220
 
 
1221
-------- switch to slave --------
 
1222
SELECT MAX(f1) FROM t1;
 
1223
MAX(f1)
 
1224
18
 
1225
 
 
1226
-------- switch to master -------
 
1227
ROLLBACK;
 
1228
SELECT MAX(f1) FROM t1;
 
1229
MAX(f1)
 
1230
18
 
1231
 
 
1232
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1233
 
 
1234
-------- switch to slave --------
 
1235
SELECT MAX(f1) FROM t1;
 
1236
MAX(f1)
 
1237
18
 
1238
 
 
1239
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1240
 
 
1241
-------- switch to master -------
 
1242
flush logs;
 
1243
 
 
1244
-------- switch to slave --------
 
1245
flush logs;
 
1246
 
 
1247
-------- switch to master -------
 
1248
SHOW PROCEDURE STATUS LIKE 'p1';
 
1249
        -------- switch to slave -------
 
1250
SHOW PROCEDURE STATUS LIKE 'p1';
 
1251
 
 
1252
######## CREATE OR REPLACE VIEW v1 as select * from t1  ########
 
1253
 
 
1254
-------- switch to master -------
 
1255
INSERT INTO t1 SET f1= 18 + 1;
 
1256
SELECT MAX(f1) FROM t1;
 
1257
MAX(f1)
 
1258
19
 
1259
 
 
1260
-------- switch to slave --------
 
1261
SELECT MAX(f1) FROM t1;
 
1262
MAX(f1)
 
1263
18
 
1264
 
 
1265
-------- switch to master -------
 
1266
CREATE OR REPLACE VIEW v1 as select * from t1;
 
1267
SELECT MAX(f1) FROM t1;
 
1268
MAX(f1)
 
1269
19
 
1270
 
 
1271
-------- switch to slave --------
 
1272
SELECT MAX(f1) FROM t1;
 
1273
MAX(f1)
 
1274
19
 
1275
 
 
1276
-------- switch to master -------
 
1277
ROLLBACK;
 
1278
SELECT MAX(f1) FROM t1;
 
1279
MAX(f1)
 
1280
19
 
1281
 
 
1282
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1283
 
 
1284
-------- switch to slave --------
 
1285
SELECT MAX(f1) FROM t1;
 
1286
MAX(f1)
 
1287
19
 
1288
 
 
1289
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1290
 
 
1291
-------- switch to master -------
 
1292
flush logs;
 
1293
 
 
1294
-------- switch to slave --------
 
1295
flush logs;
 
1296
 
 
1297
-------- switch to master -------
 
1298
SHOW CREATE VIEW v1;
 
1299
View    Create View
 
1300
v1      CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
 
1301
 
 
1302
-------- switch to slave -------
 
1303
SHOW CREATE VIEW v1;
 
1304
View    Create View
 
1305
v1      CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
 
1306
 
 
1307
######## ALTER VIEW v1 AS select f1 from t1  ########
 
1308
 
 
1309
-------- switch to master -------
 
1310
INSERT INTO t1 SET f1= 19 + 1;
 
1311
SELECT MAX(f1) FROM t1;
 
1312
MAX(f1)
 
1313
20
 
1314
 
 
1315
-------- switch to slave --------
 
1316
SELECT MAX(f1) FROM t1;
 
1317
MAX(f1)
 
1318
19
 
1319
 
 
1320
-------- switch to master -------
 
1321
ALTER VIEW v1 AS select f1 from t1;
 
1322
SELECT MAX(f1) FROM t1;
 
1323
MAX(f1)
 
1324
20
 
1325
 
 
1326
-------- switch to slave --------
 
1327
SELECT MAX(f1) FROM t1;
 
1328
MAX(f1)
 
1329
20
 
1330
 
 
1331
-------- switch to master -------
 
1332
ROLLBACK;
 
1333
SELECT MAX(f1) FROM t1;
 
1334
MAX(f1)
 
1335
20
 
1336
 
 
1337
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1338
 
 
1339
-------- switch to slave --------
 
1340
SELECT MAX(f1) FROM t1;
 
1341
MAX(f1)
 
1342
20
 
1343
 
 
1344
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1345
 
 
1346
-------- switch to master -------
 
1347
flush logs;
 
1348
 
 
1349
-------- switch to slave --------
 
1350
flush logs;
 
1351
 
 
1352
-------- switch to master -------
 
1353
SHOW CREATE VIEW v1;
 
1354
View    Create View
 
1355
v1      CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
 
1356
 
 
1357
-------- switch to slave -------
 
1358
SHOW CREATE VIEW v1;
 
1359
View    Create View
 
1360
v1      CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
 
1361
 
 
1362
######## DROP VIEW IF EXISTS v1  ########
 
1363
 
 
1364
-------- switch to master -------
 
1365
INSERT INTO t1 SET f1= 20 + 1;
 
1366
SELECT MAX(f1) FROM t1;
 
1367
MAX(f1)
 
1368
21
 
1369
 
 
1370
-------- switch to slave --------
 
1371
SELECT MAX(f1) FROM t1;
 
1372
MAX(f1)
 
1373
20
 
1374
 
 
1375
-------- switch to master -------
 
1376
DROP VIEW IF EXISTS v1;
 
1377
SELECT MAX(f1) FROM t1;
 
1378
MAX(f1)
 
1379
21
 
1380
 
 
1381
-------- switch to slave --------
 
1382
SELECT MAX(f1) FROM t1;
 
1383
MAX(f1)
 
1384
21
 
1385
 
 
1386
-------- switch to master -------
 
1387
ROLLBACK;
 
1388
SELECT MAX(f1) FROM t1;
 
1389
MAX(f1)
 
1390
21
 
1391
 
 
1392
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1393
 
 
1394
-------- switch to slave --------
 
1395
SELECT MAX(f1) FROM t1;
 
1396
MAX(f1)
 
1397
21
 
1398
 
 
1399
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1400
 
 
1401
-------- switch to master -------
 
1402
flush logs;
 
1403
 
 
1404
-------- switch to slave --------
 
1405
flush logs;
 
1406
 
 
1407
-------- switch to master -------
 
1408
SHOW CREATE VIEW v1;
 
1409
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
 
1410
 
 
1411
-------- switch to slave -------
 
1412
SHOW CREATE VIEW v1;
 
1413
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
 
1414
 
 
1415
######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1  ########
 
1416
 
 
1417
-------- switch to master -------
 
1418
INSERT INTO t1 SET f1= 21 + 1;
 
1419
SELECT MAX(f1) FROM t1;
 
1420
MAX(f1)
 
1421
22
 
1422
 
 
1423
-------- switch to slave --------
 
1424
SELECT MAX(f1) FROM t1;
 
1425
MAX(f1)
 
1426
21
 
1427
 
 
1428
-------- switch to master -------
 
1429
CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
 
1430
SELECT MAX(f1) FROM t1;
 
1431
MAX(f1)
 
1432
22
 
1433
 
 
1434
-------- switch to slave --------
 
1435
SELECT MAX(f1) FROM t1;
 
1436
MAX(f1)
 
1437
22
 
1438
 
 
1439
-------- switch to master -------
 
1440
ROLLBACK;
 
1441
SELECT MAX(f1) FROM t1;
 
1442
MAX(f1)
 
1443
22
 
1444
 
 
1445
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1446
 
 
1447
-------- switch to slave --------
 
1448
SELECT MAX(f1) FROM t1;
 
1449
MAX(f1)
 
1450
22
 
1451
 
 
1452
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1453
 
 
1454
-------- switch to master -------
 
1455
flush logs;
 
1456
 
 
1457
-------- switch to slave --------
 
1458
flush logs;
 
1459
 
 
1460
-------- switch to master -------
 
1461
SHOW TRIGGERS;
 
1462
Trigger Event   Table   Statement       Timing  Created sql_mode        Definer
 
1463
trg1    INSERT  t1      SET @a:=1       BEFORE  NULL            root@localhost
 
1464
 
 
1465
-------- switch to slave -------
 
1466
SHOW TRIGGERS;
 
1467
Trigger Event   Table   Statement       Timing  Created sql_mode        Definer
 
1468
trg1    INSERT  t1      SET @a:=1       BEFORE  NULL            root@localhost
 
1469
 
 
1470
######## DROP TRIGGER trg1  ########
 
1471
 
 
1472
-------- switch to master -------
 
1473
INSERT INTO t1 SET f1= 22 + 1;
 
1474
SELECT MAX(f1) FROM t1;
 
1475
MAX(f1)
 
1476
23
 
1477
 
 
1478
-------- switch to slave --------
 
1479
SELECT MAX(f1) FROM t1;
 
1480
MAX(f1)
 
1481
22
 
1482
 
 
1483
-------- switch to master -------
 
1484
DROP TRIGGER trg1;
 
1485
SELECT MAX(f1) FROM t1;
 
1486
MAX(f1)
 
1487
23
 
1488
 
 
1489
-------- switch to slave --------
 
1490
SELECT MAX(f1) FROM t1;
 
1491
MAX(f1)
 
1492
23
 
1493
 
 
1494
-------- switch to master -------
 
1495
ROLLBACK;
 
1496
SELECT MAX(f1) FROM t1;
 
1497
MAX(f1)
 
1498
23
 
1499
 
 
1500
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1501
 
 
1502
-------- switch to slave --------
 
1503
SELECT MAX(f1) FROM t1;
 
1504
MAX(f1)
 
1505
23
 
1506
 
 
1507
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1508
 
 
1509
-------- switch to master -------
 
1510
flush logs;
 
1511
 
 
1512
-------- switch to slave --------
 
1513
flush logs;
 
1514
 
 
1515
-------- switch to master -------
 
1516
SHOW TRIGGERS;
 
1517
Trigger Event   Table   Statement       Timing  Created sql_mode        Definer
 
1518
 
 
1519
-------- switch to slave -------
 
1520
SHOW TRIGGERS;
 
1521
Trigger Event   Table   Statement       Timing  Created sql_mode        Definer
 
1522
 
 
1523
######## CREATE USER user1@localhost  ########
 
1524
 
 
1525
-------- switch to master -------
 
1526
INSERT INTO t1 SET f1= 23 + 1;
 
1527
SELECT MAX(f1) FROM t1;
 
1528
MAX(f1)
 
1529
24
 
1530
 
 
1531
-------- switch to slave --------
 
1532
SELECT MAX(f1) FROM t1;
 
1533
MAX(f1)
 
1534
23
 
1535
 
 
1536
-------- switch to master -------
 
1537
CREATE USER user1@localhost;
 
1538
SELECT MAX(f1) FROM t1;
 
1539
MAX(f1)
 
1540
24
 
1541
 
 
1542
-------- switch to slave --------
 
1543
SELECT MAX(f1) FROM t1;
 
1544
MAX(f1)
 
1545
24
 
1546
 
 
1547
-------- switch to master -------
 
1548
ROLLBACK;
 
1549
SELECT MAX(f1) FROM t1;
 
1550
MAX(f1)
 
1551
24
 
1552
 
 
1553
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1554
 
 
1555
-------- switch to slave --------
 
1556
SELECT MAX(f1) FROM t1;
 
1557
MAX(f1)
 
1558
24
 
1559
 
 
1560
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1561
 
 
1562
-------- switch to master -------
 
1563
flush logs;
 
1564
 
 
1565
-------- switch to slave --------
 
1566
flush logs;
 
1567
 
 
1568
-------- switch to master -------
 
1569
SELECT user FROM mysql.user WHERE user = 'user1';
 
1570
user
 
1571
user1
 
1572
 
 
1573
-------- switch to slave -------
 
1574
SELECT user FROM mysql.user WHERE user = 'user1';
 
1575
user
 
1576
user1
 
1577
 
 
1578
######## RENAME USER user1@localhost TO rename1@localhost  ########
 
1579
 
 
1580
-------- switch to master -------
 
1581
INSERT INTO t1 SET f1= 24 + 1;
 
1582
SELECT MAX(f1) FROM t1;
 
1583
MAX(f1)
 
1584
25
 
1585
 
 
1586
-------- switch to slave --------
 
1587
SELECT MAX(f1) FROM t1;
 
1588
MAX(f1)
 
1589
24
 
1590
 
 
1591
-------- switch to master -------
 
1592
RENAME USER user1@localhost TO rename1@localhost;
 
1593
SELECT MAX(f1) FROM t1;
 
1594
MAX(f1)
 
1595
25
 
1596
 
 
1597
-------- switch to slave --------
 
1598
SELECT MAX(f1) FROM t1;
 
1599
MAX(f1)
 
1600
25
 
1601
 
 
1602
-------- switch to master -------
 
1603
ROLLBACK;
 
1604
SELECT MAX(f1) FROM t1;
 
1605
MAX(f1)
 
1606
25
 
1607
 
 
1608
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1609
 
 
1610
-------- switch to slave --------
 
1611
SELECT MAX(f1) FROM t1;
 
1612
MAX(f1)
 
1613
25
 
1614
 
 
1615
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1616
 
 
1617
-------- switch to master -------
 
1618
flush logs;
 
1619
 
 
1620
-------- switch to slave --------
 
1621
flush logs;
 
1622
 
 
1623
-------- switch to master -------
 
1624
SELECT user FROM mysql.user WHERE user = 'rename1';
 
1625
user
 
1626
rename1
 
1627
 
 
1628
-------- switch to slave -------
 
1629
SELECT user FROM mysql.user WHERE user = 'rename1';
 
1630
user
 
1631
rename1
 
1632
 
 
1633
######## DROP USER rename1@localhost  ########
 
1634
 
 
1635
-------- switch to master -------
 
1636
INSERT INTO t1 SET f1= 25 + 1;
 
1637
SELECT MAX(f1) FROM t1;
 
1638
MAX(f1)
 
1639
26
 
1640
 
 
1641
-------- switch to slave --------
 
1642
SELECT MAX(f1) FROM t1;
 
1643
MAX(f1)
 
1644
25
 
1645
 
 
1646
-------- switch to master -------
 
1647
DROP USER rename1@localhost;
 
1648
SELECT MAX(f1) FROM t1;
 
1649
MAX(f1)
 
1650
26
 
1651
 
 
1652
-------- switch to slave --------
 
1653
SELECT MAX(f1) FROM t1;
 
1654
MAX(f1)
 
1655
26
 
1656
 
 
1657
-------- switch to master -------
 
1658
ROLLBACK;
 
1659
SELECT MAX(f1) FROM t1;
 
1660
MAX(f1)
 
1661
26
 
1662
 
 
1663
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
 
1664
 
 
1665
-------- switch to slave --------
 
1666
SELECT MAX(f1) FROM t1;
 
1667
MAX(f1)
 
1668
26
 
1669
 
 
1670
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
 
1671
 
 
1672
-------- switch to master -------
 
1673
flush logs;
 
1674
 
 
1675
-------- switch to slave --------
 
1676
flush logs;
 
1677
 
 
1678
-------- switch to master -------
 
1679
SELECT user FROM mysql.user WHERE user = 'rename1';
 
1680
user
 
1681
 
 
1682
-------- switch to slave -------
 
1683
SELECT user FROM mysql.user WHERE user = 'rename1';
 
1684
user
 
1685
DROP DATABASE IF EXISTS mysqltest1;
 
1686
DROP DATABASE IF EXISTS mysqltest2;
 
1687
DROP DATABASE IF EXISTS mysqltest3;
 
1688
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction