rpl_ddl.result 19.4 KB
Newer Older
1 2 3 4 5 6 7
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
SET AUTOCOMMIT = 1;
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
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2;
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB";
INSERT INTO mysqltest1.t1 SET f1= 0;
CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB";
CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB";
INSERT INTO mysqltest1.t7 SET f1= 0;
CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT);
36
SET AUTOCOMMIT = 0;
37
use mysqltest1;
38 39

-------- switch to slave --------
40 41
SET AUTOCOMMIT = 0;
use mysqltest1;
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

-------- switch to master -------

######## COMMIT  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 0 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
1

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
0

-------- switch to master -------
COMMIT;
SELECT MAX(f1) FROM t1;
MAX(f1)
1

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
1

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
1

75
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
76 77 78 79 80 81

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
1

82
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
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

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------

######## ROLLBACK  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 1 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
2

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
1

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
1

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
1

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
1

122
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
123 124 125 126 127 128

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
1

129
TEST-INFO: SLAVE:  The INSERT is not committed (Succeeded)
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

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------

######## SET AUTOCOMMIT=1  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 1 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
2

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
1

-------- switch to master -------
SET AUTOCOMMIT=1;
SELECT MAX(f1) FROM t1;
MAX(f1)
2

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
2

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
2

169
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
170 171 172 173 174 175

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
2

176
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
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

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
SET AUTOCOMMIT=0;

######## START TRANSACTION  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 2 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
3

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
2

-------- switch to master -------
START TRANSACTION;
SELECT MAX(f1) FROM t1;
MAX(f1)
3

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
3

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
3

217
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
218 219 220 221 222 223

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
3

224
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
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

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------

######## BEGIN  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 3 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
4

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
3

-------- switch to master -------
BEGIN;
SELECT MAX(f1) FROM t1;
MAX(f1)
4

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
4

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
4

264
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
265 266 267 268 269 270

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
4

271
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
272 273 274 275 276 277 278 279 280

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------

281
######## DROP TABLE mysqltest1.t2  ########
282 283 284 285 286 287 288 289 290 291 292 293 294

-------- switch to master -------
INSERT INTO t1 SET f1= 4 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
5

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
4

-------- switch to master -------
295
DROP TABLE mysqltest1.t2;
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
SELECT MAX(f1) FROM t1;
MAX(f1)
5

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
5

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
5

311
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
312 313 314 315 316 317

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
5

318
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
319 320 321 322 323 324 325 326 327

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
SHOW TABLES LIKE 't2';
328
Tables_in_mysqltest1 (t2)
329 330 331

-------- switch to slave --------
SHOW TABLES LIKE 't2';
332
Tables_in_mysqltest1 (t2)
333 334 335

-------- switch to master -------

336
######## DROP TEMPORARY TABLE mysqltest1.t23  ########
337 338 339 340 341 342 343 344 345 346 347 348 349

-------- switch to master -------
INSERT INTO t1 SET f1= 5 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
6

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
5

-------- switch to master -------
350
DROP TEMPORARY TABLE mysqltest1.t23;
351 352 353 354 355 356 357
SELECT MAX(f1) FROM t1;
MAX(f1)
6

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
358
5
359 360 361

-------- switch to master -------
ROLLBACK;
362 363
Warnings:
Warning	1196	Some non-transactional changed tables couldn't be rolled back
364 365
SELECT MAX(f1) FROM t1;
MAX(f1)
366
5
367

368
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
369 370 371 372 373 374

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
6

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
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
SHOW TABLES LIKE 't23';
Tables_in_mysqltest1 (t23)

-------- switch to slave --------
SHOW TABLES LIKE 't23';
Tables_in_mysqltest1 (t23)

-------- switch to master -------

######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 5 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
6

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
6

-------- switch to master -------
RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
SELECT MAX(f1) FROM t1;
MAX(f1)
6

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
6

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
6

TEST-INFO: MASTER: The INSERT is committed (Succeeded)

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
6

TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
431 432 433 434 435 436 437 438 439

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
SHOW TABLES LIKE 't20';
440
Tables_in_mysqltest1 (t20)
441 442 443 444
t20

-------- switch to slave --------
SHOW TABLES LIKE 't20';
445
Tables_in_mysqltest1 (t20)
446 447 448 449
t20

-------- switch to master -------

450
######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT  ########
451 452 453 454 455 456 457 458 459 460 461 462 463

-------- switch to master -------
INSERT INTO t1 SET f1= 6 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
7

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
6

-------- switch to master -------
464
ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479
SELECT MAX(f1) FROM t1;
MAX(f1)
7

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
7

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
7

480
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
481 482 483 484 485 486

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
7

487
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
488 489 490 491 492 493 494 495

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
496
describe mysqltest1.t4;
497 498 499 500 501
Field	Type	Null	Key	Default	Extra
f1	bigint(20)	YES		NULL	
f2	bigint(20)	YES		NULL	

-------- switch to slave --------
502
describe mysqltest1.t4;
503 504 505 506 507 508
Field	Type	Null	Key	Default	Extra
f1	bigint(20)	YES		NULL	
f2	bigint(20)	YES		NULL	

-------- switch to master -------

509
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB"  ########
510 511 512 513 514 515 516 517 518 519 520 521 522

-------- switch to master -------
INSERT INTO t1 SET f1= 7 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
8

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
7

-------- switch to master -------
523
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB";
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538
SELECT MAX(f1) FROM t1;
MAX(f1)
8

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
8

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
8

539
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
540 541 542 543 544 545

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
8

546
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
547 548 549 550 551 552 553 554 555

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------

556
######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT)  ########
557 558 559 560 561 562 563 564 565 566 567 568 569

-------- switch to master -------
INSERT INTO t1 SET f1= 8 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
9

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
8

-------- switch to master -------
570
CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT);
571 572 573
SELECT MAX(f1) FROM t1;
MAX(f1)
9
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
8

-------- switch to master -------
ROLLBACK;
Warnings:
Warning	1196	Some non-transactional changed tables couldn't be rolled back
SELECT MAX(f1) FROM t1;
MAX(f1)
8

TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
589 590 591 592 593

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
9
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

TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------

######## TRUNCATE TABLE mysqltest1.t7  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 8 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
9

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
9

-------- switch to master -------
TRUNCATE TABLE mysqltest1.t7;
SELECT MAX(f1) FROM t1;
MAX(f1)
9

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
9
628 629 630 631 632 633 634

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
9

635
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
636 637 638 639 640 641

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
9

642
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
643 644 645 646 647 648 649 650

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
651
SELECT * FROM mysqltest1.t7;
652 653 654
f1

-------- switch to slave --------
655
SELECT * FROM mysqltest1.t7;
656 657 658 659
f1

-------- switch to master -------

660
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ  ########
661 662 663 664 665 666 667 668 669 670 671 672 673

-------- switch to master -------
INSERT INTO t1 SET f1= 9 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
10

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
9

-------- switch to master -------
674
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689
SELECT MAX(f1) FROM t1;
MAX(f1)
10

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
10

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
10

690
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
691 692 693 694 695 696

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
10

697
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
UNLOCK TABLES;

######## UNLOCK TABLES  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 10 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
11

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
10

-------- switch to master -------
UNLOCK TABLES;
SELECT MAX(f1) FROM t1;
MAX(f1)
11
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
10

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
10

TEST-INFO: MASTER: The INSERT is not committed (Succeeded)

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
10

TEST-INFO: SLAVE:  The INSERT is not committed (Succeeded)

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
LOCK TABLES mysqltest1.t1 READ;

######## UNLOCK TABLES  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 10 + 1;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
SELECT MAX(f1) FROM t1;
MAX(f1)
10

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
10

-------- switch to master -------
UNLOCK TABLES;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
775 776 777 778

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810
10

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
10

TEST-INFO: MASTER: The INSERT is not committed (Succeeded)

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
10

TEST-INFO: SLAVE:  The INSERT is not committed (Succeeded)

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;

######## UNLOCK TABLES  ########

-------- switch to master -------
INSERT INTO t1 SET f1= 10 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
811
11
812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
10

-------- switch to master -------
UNLOCK TABLES;
SELECT MAX(f1) FROM t1;
MAX(f1)
11

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
11
828 829 830 831 832 833 834

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
11

835
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
836 837 838 839 840 841

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
11

842
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
843 844 845 846 847 848 849 850 851

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------

852
######## DROP INDEX my_idx6 ON mysqltest1.t6  ########
853 854 855 856 857 858 859 860 861 862 863 864 865

-------- switch to master -------
INSERT INTO t1 SET f1= 11 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
12

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
11

-------- switch to master -------
866
DROP INDEX my_idx6 ON mysqltest1.t6;
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881
SELECT MAX(f1) FROM t1;
MAX(f1)
12

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
12

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
12

882
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
883 884 885 886 887 888

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
12

889
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
890 891 892 893 894 895 896 897

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
898
SHOW INDEX FROM mysqltest1.t6;
899 900 901
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment

-------- switch to slave --------
902
SHOW INDEX FROM mysqltest1.t6;
903 904 905 906
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment

-------- switch to master -------

907
######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1)  ########
908 909 910 911 912 913 914 915 916 917 918 919 920

-------- switch to master -------
INSERT INTO t1 SET f1= 12 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
13

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
12

-------- switch to master -------
921
CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
922 923 924 925 926 927 928 929 930 931 932 933 934 935 936
SELECT MAX(f1) FROM t1;
MAX(f1)
13

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
13

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
13

937
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
938 939 940 941 942 943

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
13

944
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
945 946 947 948 949 950 951 952

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
953
SHOW INDEX FROM mysqltest1.t5;
954 955 956 957
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
t5	1	my_idx5	1	f1	A	0	NULL	NULL	YES	BTREE	

-------- switch to slave --------
958
SHOW INDEX FROM mysqltest1.t5;
959 960 961 962 963
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
t5	1	my_idx5	1	f1	A	NULL	NULL	NULL	YES	BTREE	

-------- switch to master -------

964
######## DROP DATABASE mysqltest2  ########
965 966 967 968 969 970 971 972 973 974 975 976 977

-------- switch to master -------
INSERT INTO t1 SET f1= 13 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
14

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
13

-------- switch to master -------
978
DROP DATABASE mysqltest2;
979 980 981 982 983 984 985 986 987 988 989 990 991 992 993
SELECT MAX(f1) FROM t1;
MAX(f1)
14

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
14

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
14

994
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
995 996 997 998 999 1000

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
14

1001
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
1002 1003 1004 1005 1006 1007 1008 1009

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
1010 1011
SHOW DATABASES LIKE "mysqltest2";
Database (mysqltest2)
1012 1013

-------- switch to slave --------
1014 1015
SHOW DATABASES LIKE "mysqltest2";
Database (mysqltest2)
1016 1017 1018

-------- switch to master -------

1019
######## CREATE DATABASE mysqltest3  ########
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032

-------- switch to master -------
INSERT INTO t1 SET f1= 14 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
15

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
14

-------- switch to master -------
1033
CREATE DATABASE mysqltest3;
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048
SELECT MAX(f1) FROM t1;
MAX(f1)
15

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
15

-------- switch to master -------
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
15

1049
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
1050 1051 1052 1053 1054 1055

-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
15

1056
TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
1057 1058 1059 1060 1061 1062 1063 1064

-------- switch to master -------
flush logs;

-------- switch to slave --------
flush logs;

-------- switch to master -------
1065 1066 1067
SHOW DATABASES LIKE "mysqltest3";
Database (mysqltest3)
mysqltest3
1068 1069

-------- switch to slave --------
1070 1071 1072
SHOW DATABASES LIKE "mysqltest3";
Database (mysqltest3)
mysqltest3
1073 1074

-------- switch to master -------
1075 1076 1077
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;