diff options
author | unknown <lars@mysql.com> | 2005-05-27 04:17:33 +0200 |
---|---|---|
committer | unknown <lars@mysql.com> | 2005-05-27 04:17:33 +0200 |
commit | 6e7dd94ea4622dad0cd01672561ffd818e42c638 (patch) | |
tree | f269502f0f85462c8f1be557aca1ec7287dc9682 /mysql-test/r/rpl_ddl.result | |
parent | 605f7061dc2ca28d78ad652b9b5a7225f55ccb9a (diff) | |
download | mariadb-git-6e7dd94ea4622dad0cd01672561ffd818e42c638.tar.gz |
BUG#6883: Added implicit commit for CREATE TABLE, TRUNCATE TABLE and DROP/CREATE DATABASE
mysql-test/r/innodb.result:
Truncate table now work even if there is open trx
mysql-test/r/innodb_cache.result:
One query in cache
mysql-test/t/innodb.test:
Truncate table now succeed even if there is an open transaction
sql/sql_parse.cc:
Added implicit commit for temp table CREATE TABLE, TRUNCATE TABLE, CREATE/DROP DATABASE.
Diffstat (limited to 'mysql-test/r/rpl_ddl.result')
-rw-r--r-- | mysql-test/r/rpl_ddl.result | 1394 |
1 files changed, 1394 insertions, 0 deletions
diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/r/rpl_ddl.result new file mode 100644 index 00000000000..7e544a609e8 --- /dev/null +++ b/mysql-test/r/rpl_ddl.result @@ -0,0 +1,1394 @@ +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; +DROP DATABASE IF EXISTS d1; +DROP DATABASE IF EXISTS d2; +DROP DATABASE IF EXISTS d3; +CREATE DATABASE d1; +CREATE DATABASE d2; +CREATE TABLE d1.t1 (f1 BIGINT) ENGINE= "InnoDB"; +INSERT INTO d1.t1 SET f1= 0; +CREATE TABLE d1.t2 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t3 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t4 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t5 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t6 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE INDEX my_idx6 ON d1.t6(f1); +CREATE TABLE d1.t7 (f1 BIGINT) ENGINE= "InnoDB"; +INSERT INTO d1.t7 SET f1= 0; +CREATE TABLE d1.t8 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t9 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t10 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t11 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t12 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t13 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t14 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t15 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t16 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t17 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t18 (f1 BIGINT) ENGINE= "InnoDB"; +CREATE TABLE d1.t19 (f1 BIGINT) ENGINE= "InnoDB"; +COMMIT; +SET AUTOCOMMIT = 0; +use d1; + +-------- switch to slave -------- +SET AUTOCOMMIT = 1; +use d1; + +-------- switch to master ------- + +######## COMMIT ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 0 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 +SHOW BINLOG EVENTS IN 'master-bin.000001'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 DROP DATABASE IF EXISTS d1 +master-bin.000001 138 Query 1 138 DROP DATABASE IF EXISTS d2 +master-bin.000001 197 Query 1 197 DROP DATABASE IF EXISTS d3 +master-bin.000001 256 Query 1 256 CREATE DATABASE d1 +master-bin.000001 307 Query 1 307 CREATE DATABASE d2 +master-bin.000001 358 Query 1 358 use `test`; CREATE TABLE d1.t1 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 440 Query 1 440 use `test`; INSERT INTO d1.t1 SET f1= 0 +master-bin.000001 502 Query 1 502 use `test`; CREATE TABLE d1.t2 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 584 Query 1 584 use `test`; CREATE TABLE d1.t3 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 666 Query 1 666 use `test`; CREATE TABLE d1.t4 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 748 Query 1 748 use `test`; CREATE TABLE d1.t5 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 830 Query 1 830 use `test`; CREATE TABLE d1.t6 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 912 Query 1 912 use `test`; CREATE INDEX my_idx6 ON d1.t6(f1) +master-bin.000001 980 Query 1 980 use `test`; CREATE TABLE d1.t7 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1062 Query 1 1062 use `test`; INSERT INTO d1.t7 SET f1= 0 +master-bin.000001 1124 Query 1 1124 use `test`; CREATE TABLE d1.t8 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1206 Query 1 1206 use `test`; CREATE TABLE d1.t9 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1288 Query 1 1288 use `test`; CREATE TABLE d1.t10 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1371 Query 1 1371 use `test`; CREATE TABLE d1.t11 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1454 Query 1 1454 use `test`; CREATE TABLE d1.t12 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1537 Query 1 1537 use `test`; CREATE TABLE d1.t13 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1620 Query 1 1620 use `test`; CREATE TABLE d1.t14 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1703 Query 1 1703 use `test`; CREATE TABLE d1.t15 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1786 Query 1 1786 use `test`; CREATE TABLE d1.t16 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1869 Query 1 1869 use `test`; CREATE TABLE d1.t17 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1952 Query 1 1952 use `test`; CREATE TABLE d1.t18 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 2035 Query 1 2035 use `test`; CREATE TABLE d1.t19 (f1 BIGINT) ENGINE= "InnoDB" + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +0 +SHOW BINLOG EVENTS IN 'slave-bin.000001'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3 +slave-bin.000001 79 Query 2 79 use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9 +slave-bin.000001 161 Query 1 161 DROP DATABASE IF EXISTS d1 +slave-bin.000001 220 Query 1 220 DROP DATABASE IF EXISTS d2 +slave-bin.000001 279 Query 1 279 DROP DATABASE IF EXISTS d3 +slave-bin.000001 338 Query 1 338 CREATE DATABASE d1 +slave-bin.000001 389 Query 1 389 CREATE DATABASE d2 +slave-bin.000001 440 Query 1 440 use `test`; CREATE TABLE d1.t1 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 522 Query 1 522 use `test`; INSERT INTO d1.t1 SET f1= 0 +slave-bin.000001 584 Query 1 584 use `test`; CREATE TABLE d1.t2 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 666 Query 1 666 use `test`; CREATE TABLE d1.t3 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 748 Query 1 748 use `test`; CREATE TABLE d1.t4 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 830 Query 1 830 use `test`; CREATE TABLE d1.t5 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 912 Query 1 912 use `test`; CREATE TABLE d1.t6 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 994 Query 1 994 use `test`; CREATE INDEX my_idx6 ON d1.t6(f1) +slave-bin.000001 1062 Query 1 1062 use `test`; CREATE TABLE d1.t7 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1144 Query 1 1144 use `test`; INSERT INTO d1.t7 SET f1= 0 +slave-bin.000001 1206 Query 1 1206 use `test`; CREATE TABLE d1.t8 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1288 Query 1 1288 use `test`; CREATE TABLE d1.t9 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1370 Query 1 1370 use `test`; CREATE TABLE d1.t10 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1453 Query 1 1453 use `test`; CREATE TABLE d1.t11 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1536 Query 1 1536 use `test`; CREATE TABLE d1.t12 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1619 Query 1 1619 use `test`; CREATE TABLE d1.t13 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1702 Query 1 1702 use `test`; CREATE TABLE d1.t14 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1785 Query 1 1785 use `test`; CREATE TABLE d1.t15 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1868 Query 1 1868 use `test`; CREATE TABLE d1.t16 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1951 Query 1 1951 use `test`; CREATE TABLE d1.t17 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 2034 Query 1 2034 use `test`; CREATE TABLE d1.t18 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 2117 Query 1 2117 use `test`; CREATE TABLE d1.t19 (f1 BIGINT) ENGINE= "InnoDB" + +-------- switch to master ------- +COMMIT; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 +SHOW BINLOG EVENTS IN 'master-bin.000001'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 DROP DATABASE IF EXISTS d1 +master-bin.000001 138 Query 1 138 DROP DATABASE IF EXISTS d2 +master-bin.000001 197 Query 1 197 DROP DATABASE IF EXISTS d3 +master-bin.000001 256 Query 1 256 CREATE DATABASE d1 +master-bin.000001 307 Query 1 307 CREATE DATABASE d2 +master-bin.000001 358 Query 1 358 use `test`; CREATE TABLE d1.t1 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 440 Query 1 440 use `test`; INSERT INTO d1.t1 SET f1= 0 +master-bin.000001 502 Query 1 502 use `test`; CREATE TABLE d1.t2 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 584 Query 1 584 use `test`; CREATE TABLE d1.t3 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 666 Query 1 666 use `test`; CREATE TABLE d1.t4 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 748 Query 1 748 use `test`; CREATE TABLE d1.t5 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 830 Query 1 830 use `test`; CREATE TABLE d1.t6 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 912 Query 1 912 use `test`; CREATE INDEX my_idx6 ON d1.t6(f1) +master-bin.000001 980 Query 1 980 use `test`; CREATE TABLE d1.t7 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1062 Query 1 1062 use `test`; INSERT INTO d1.t7 SET f1= 0 +master-bin.000001 1124 Query 1 1124 use `test`; CREATE TABLE d1.t8 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1206 Query 1 1206 use `test`; CREATE TABLE d1.t9 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1288 Query 1 1288 use `test`; CREATE TABLE d1.t10 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1371 Query 1 1371 use `test`; CREATE TABLE d1.t11 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1454 Query 1 1454 use `test`; CREATE TABLE d1.t12 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1537 Query 1 1537 use `test`; CREATE TABLE d1.t13 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1620 Query 1 1620 use `test`; CREATE TABLE d1.t14 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1703 Query 1 1703 use `test`; CREATE TABLE d1.t15 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1786 Query 1 1786 use `test`; CREATE TABLE d1.t16 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1869 Query 1 1869 use `test`; CREATE TABLE d1.t17 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1952 Query 1 1952 use `test`; CREATE TABLE d1.t18 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 2035 Query 1 2035 use `test`; CREATE TABLE d1.t19 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 2118 Query 1 2118 use `d1`; BEGIN +master-bin.000001 2156 Query 1 2118 use `d1`; INSERT INTO t1 SET f1= 0 + 1 +master-bin.000001 2217 Query 1 2217 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 +SHOW BINLOG EVENTS IN 'slave-bin.000001'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3 +slave-bin.000001 79 Query 2 79 use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9 +slave-bin.000001 161 Query 1 161 DROP DATABASE IF EXISTS d1 +slave-bin.000001 220 Query 1 220 DROP DATABASE IF EXISTS d2 +slave-bin.000001 279 Query 1 279 DROP DATABASE IF EXISTS d3 +slave-bin.000001 338 Query 1 338 CREATE DATABASE d1 +slave-bin.000001 389 Query 1 389 CREATE DATABASE d2 +slave-bin.000001 440 Query 1 440 use `test`; CREATE TABLE d1.t1 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 522 Query 1 522 use `test`; INSERT INTO d1.t1 SET f1= 0 +slave-bin.000001 584 Query 1 584 use `test`; CREATE TABLE d1.t2 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 666 Query 1 666 use `test`; CREATE TABLE d1.t3 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 748 Query 1 748 use `test`; CREATE TABLE d1.t4 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 830 Query 1 830 use `test`; CREATE TABLE d1.t5 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 912 Query 1 912 use `test`; CREATE TABLE d1.t6 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 994 Query 1 994 use `test`; CREATE INDEX my_idx6 ON d1.t6(f1) +slave-bin.000001 1062 Query 1 1062 use `test`; CREATE TABLE d1.t7 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1144 Query 1 1144 use `test`; INSERT INTO d1.t7 SET f1= 0 +slave-bin.000001 1206 Query 1 1206 use `test`; CREATE TABLE d1.t8 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1288 Query 1 1288 use `test`; CREATE TABLE d1.t9 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1370 Query 1 1370 use `test`; CREATE TABLE d1.t10 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1453 Query 1 1453 use `test`; CREATE TABLE d1.t11 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1536 Query 1 1536 use `test`; CREATE TABLE d1.t12 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1619 Query 1 1619 use `test`; CREATE TABLE d1.t13 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1702 Query 1 1702 use `test`; CREATE TABLE d1.t14 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1785 Query 1 1785 use `test`; CREATE TABLE d1.t15 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1868 Query 1 1868 use `test`; CREATE TABLE d1.t16 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1951 Query 1 1951 use `test`; CREATE TABLE d1.t17 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 2034 Query 1 2034 use `test`; CREATE TABLE d1.t18 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 2117 Query 1 2117 use `test`; CREATE TABLE d1.t19 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 2200 Query 1 2200 use `d1`; INSERT INTO t1 SET f1= 0 + 1 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000001'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 DROP DATABASE IF EXISTS d1 +master-bin.000001 138 Query 1 138 DROP DATABASE IF EXISTS d2 +master-bin.000001 197 Query 1 197 DROP DATABASE IF EXISTS d3 +master-bin.000001 256 Query 1 256 CREATE DATABASE d1 +master-bin.000001 307 Query 1 307 CREATE DATABASE d2 +master-bin.000001 358 Query 1 358 use `test`; CREATE TABLE d1.t1 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 440 Query 1 440 use `test`; INSERT INTO d1.t1 SET f1= 0 +master-bin.000001 502 Query 1 502 use `test`; CREATE TABLE d1.t2 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 584 Query 1 584 use `test`; CREATE TABLE d1.t3 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 666 Query 1 666 use `test`; CREATE TABLE d1.t4 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 748 Query 1 748 use `test`; CREATE TABLE d1.t5 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 830 Query 1 830 use `test`; CREATE TABLE d1.t6 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 912 Query 1 912 use `test`; CREATE INDEX my_idx6 ON d1.t6(f1) +master-bin.000001 980 Query 1 980 use `test`; CREATE TABLE d1.t7 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1062 Query 1 1062 use `test`; INSERT INTO d1.t7 SET f1= 0 +master-bin.000001 1124 Query 1 1124 use `test`; CREATE TABLE d1.t8 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1206 Query 1 1206 use `test`; CREATE TABLE d1.t9 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1288 Query 1 1288 use `test`; CREATE TABLE d1.t10 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1371 Query 1 1371 use `test`; CREATE TABLE d1.t11 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1454 Query 1 1454 use `test`; CREATE TABLE d1.t12 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1537 Query 1 1537 use `test`; CREATE TABLE d1.t13 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1620 Query 1 1620 use `test`; CREATE TABLE d1.t14 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1703 Query 1 1703 use `test`; CREATE TABLE d1.t15 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1786 Query 1 1786 use `test`; CREATE TABLE d1.t16 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1869 Query 1 1869 use `test`; CREATE TABLE d1.t17 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 1952 Query 1 1952 use `test`; CREATE TABLE d1.t18 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 2035 Query 1 2035 use `test`; CREATE TABLE d1.t19 (f1 BIGINT) ENGINE= "InnoDB" +master-bin.000001 2118 Query 1 2118 use `d1`; BEGIN +master-bin.000001 2156 Query 1 2118 use `d1`; INSERT INTO t1 SET f1= 0 + 1 +master-bin.000001 2217 Query 1 2217 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000001'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000001 4 Start 2 4 Server ver: VERSION, Binlog ver: 3 +slave-bin.000001 79 Query 2 79 use `test`; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9 +slave-bin.000001 161 Query 1 161 DROP DATABASE IF EXISTS d1 +slave-bin.000001 220 Query 1 220 DROP DATABASE IF EXISTS d2 +slave-bin.000001 279 Query 1 279 DROP DATABASE IF EXISTS d3 +slave-bin.000001 338 Query 1 338 CREATE DATABASE d1 +slave-bin.000001 389 Query 1 389 CREATE DATABASE d2 +slave-bin.000001 440 Query 1 440 use `test`; CREATE TABLE d1.t1 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 522 Query 1 522 use `test`; INSERT INTO d1.t1 SET f1= 0 +slave-bin.000001 584 Query 1 584 use `test`; CREATE TABLE d1.t2 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 666 Query 1 666 use `test`; CREATE TABLE d1.t3 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 748 Query 1 748 use `test`; CREATE TABLE d1.t4 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 830 Query 1 830 use `test`; CREATE TABLE d1.t5 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 912 Query 1 912 use `test`; CREATE TABLE d1.t6 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 994 Query 1 994 use `test`; CREATE INDEX my_idx6 ON d1.t6(f1) +slave-bin.000001 1062 Query 1 1062 use `test`; CREATE TABLE d1.t7 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1144 Query 1 1144 use `test`; INSERT INTO d1.t7 SET f1= 0 +slave-bin.000001 1206 Query 1 1206 use `test`; CREATE TABLE d1.t8 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1288 Query 1 1288 use `test`; CREATE TABLE d1.t9 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1370 Query 1 1370 use `test`; CREATE TABLE d1.t10 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1453 Query 1 1453 use `test`; CREATE TABLE d1.t11 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1536 Query 1 1536 use `test`; CREATE TABLE d1.t12 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1619 Query 1 1619 use `test`; CREATE TABLE d1.t13 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1702 Query 1 1702 use `test`; CREATE TABLE d1.t14 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1785 Query 1 1785 use `test`; CREATE TABLE d1.t15 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1868 Query 1 1868 use `test`; CREATE TABLE d1.t16 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 1951 Query 1 1951 use `test`; CREATE TABLE d1.t17 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 2034 Query 1 2034 use `test`; CREATE TABLE d1.t18 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 2117 Query 1 2117 use `test`; CREATE TABLE d1.t19 (f1 BIGINT) ENGINE= "InnoDB" +slave-bin.000001 2200 Query 1 2200 use `d1`; INSERT INTO t1 SET f1= 0 + 1 + +-------- 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 +SHOW BINLOG EVENTS IN 'master-bin.000002'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 +SHOW BINLOG EVENTS IN 'slave-bin.000002'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 +SHOW BINLOG EVENTS IN 'master-bin.000002'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 +SHOW BINLOG EVENTS IN 'slave-bin.000002'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +TEST-INFO: MASTER: The INSERT is not committed +SHOW BINLOG EVENTS IN 'master-bin.000002'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 + +TEST-INFO: SLAVE: The INSERT is not committed +SHOW BINLOG EVENTS IN 'slave-bin.000002'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- 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 +SHOW BINLOG EVENTS IN 'master-bin.000003'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +1 +SHOW BINLOG EVENTS IN 'slave-bin.000003'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +SET AUTOCOMMIT=1; +SELECT MAX(f1) FROM t1; +MAX(f1) +2 +SHOW BINLOG EVENTS IN 'master-bin.000003'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000003 4 Query 1 4 use `d1`; BEGIN +master-bin.000003 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 1 + 1 +master-bin.000003 103 Query 1 103 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +2 +SHOW BINLOG EVENTS IN 'slave-bin.000003'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000003 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 1 + 1 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +2 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000003'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000003 4 Query 1 4 use `d1`; BEGIN +master-bin.000003 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 1 + 1 +master-bin.000003 103 Query 1 103 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +2 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000003'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000003 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 1 + 1 + +-------- 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 +SHOW BINLOG EVENTS IN 'master-bin.000004'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +2 +SHOW BINLOG EVENTS IN 'slave-bin.000004'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +START TRANSACTION; +SELECT MAX(f1) FROM t1; +MAX(f1) +3 +SHOW BINLOG EVENTS IN 'master-bin.000004'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000004 4 Query 1 4 use `d1`; BEGIN +master-bin.000004 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 2 + 1 +master-bin.000004 103 Query 1 103 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +3 +SHOW BINLOG EVENTS IN 'slave-bin.000004'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000004 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 2 + 1 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +3 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000004'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000004 4 Query 1 4 use `d1`; BEGIN +master-bin.000004 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 2 + 1 +master-bin.000004 103 Query 1 103 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +3 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000004'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000004 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 2 + 1 + +-------- 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 +SHOW BINLOG EVENTS IN 'master-bin.000005'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +3 +SHOW BINLOG EVENTS IN 'slave-bin.000005'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +BEGIN; +SELECT MAX(f1) FROM t1; +MAX(f1) +4 +SHOW BINLOG EVENTS IN 'master-bin.000005'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000005 4 Query 1 4 use `d1`; BEGIN +master-bin.000005 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 3 + 1 +master-bin.000005 103 Query 1 103 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +4 +SHOW BINLOG EVENTS IN 'slave-bin.000005'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000005 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 3 + 1 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +4 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000005'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000005 4 Query 1 4 use `d1`; BEGIN +master-bin.000005 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 3 + 1 +master-bin.000005 103 Query 1 103 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +4 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000005'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000005 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 3 + 1 + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## DROP TABLE d1.t2 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 4 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +5 +SHOW BINLOG EVENTS IN 'master-bin.000006'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +4 +SHOW BINLOG EVENTS IN 'slave-bin.000006'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +DROP TABLE d1.t2; +SELECT MAX(f1) FROM t1; +MAX(f1) +5 +SHOW BINLOG EVENTS IN 'master-bin.000006'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000006 4 Query 1 4 use `d1`; BEGIN +master-bin.000006 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 4 + 1 +master-bin.000006 103 Query 1 103 use `d1`; COMMIT +master-bin.000006 142 Query 1 142 use `d1`; DROP TABLE d1.t2 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +5 +SHOW BINLOG EVENTS IN 'slave-bin.000006'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000006 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 4 + 1 +slave-bin.000006 65 Query 1 65 use `d1`; DROP TABLE d1.t2 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000006'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000006 4 Query 1 4 use `d1`; BEGIN +master-bin.000006 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 4 + 1 +master-bin.000006 103 Query 1 103 use `d1`; COMMIT +master-bin.000006 142 Query 1 142 use `d1`; DROP TABLE d1.t2 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +5 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000006'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000006 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 4 + 1 +slave-bin.000006 65 Query 1 65 use `d1`; DROP TABLE d1.t2 + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TABLES LIKE 't2'; +Tables_in_d1 (t2) + +-------- switch to slave -------- +SHOW TABLES LIKE 't2'; +Tables_in_d1 (t2) + +-------- switch to master ------- + +######## RENAME TABLE d1.t3 to d1.t20 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 5 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +6 +SHOW BINLOG EVENTS IN 'master-bin.000007'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +5 +SHOW BINLOG EVENTS IN 'slave-bin.000007'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +RENAME TABLE d1.t3 to d1.t20; +SELECT MAX(f1) FROM t1; +MAX(f1) +6 +SHOW BINLOG EVENTS IN 'master-bin.000007'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000007 4 Query 1 4 use `d1`; BEGIN +master-bin.000007 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 5 + 1 +master-bin.000007 103 Query 1 103 use `d1`; COMMIT +master-bin.000007 142 Query 1 142 use `d1`; RENAME TABLE d1.t3 to d1.t20 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +6 +SHOW BINLOG EVENTS IN 'slave-bin.000007'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000007 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 5 + 1 +slave-bin.000007 65 Query 1 65 use `d1`; RENAME TABLE d1.t3 to d1.t20 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000007'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000007 4 Query 1 4 use `d1`; BEGIN +master-bin.000007 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 5 + 1 +master-bin.000007 103 Query 1 103 use `d1`; COMMIT +master-bin.000007 142 Query 1 142 use `d1`; RENAME TABLE d1.t3 to d1.t20 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +6 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000007'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000007 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 5 + 1 +slave-bin.000007 65 Query 1 65 use `d1`; RENAME TABLE d1.t3 to d1.t20 + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TABLES LIKE 't20'; +Tables_in_d1 (t20) +t20 + +-------- switch to slave -------- +SHOW TABLES LIKE 't20'; +Tables_in_d1 (t20) +t20 + +-------- switch to master ------- + +######## ALTER TABLE d1.t4 ADD column f2 BIGINT ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 6 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +7 +SHOW BINLOG EVENTS IN 'master-bin.000008'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +6 +SHOW BINLOG EVENTS IN 'slave-bin.000008'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +ALTER TABLE d1.t4 ADD column f2 BIGINT; +SELECT MAX(f1) FROM t1; +MAX(f1) +7 +SHOW BINLOG EVENTS IN 'master-bin.000008'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000008 4 Query 1 4 use `d1`; BEGIN +master-bin.000008 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 6 + 1 +master-bin.000008 103 Query 1 103 use `d1`; COMMIT +master-bin.000008 142 Query 1 142 use `d1`; ALTER TABLE d1.t4 ADD column f2 BIGINT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +7 +SHOW BINLOG EVENTS IN 'slave-bin.000008'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000008 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 6 + 1 +slave-bin.000008 65 Query 1 65 use `d1`; ALTER TABLE d1.t4 ADD column f2 BIGINT + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +7 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000008'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000008 4 Query 1 4 use `d1`; BEGIN +master-bin.000008 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 6 + 1 +master-bin.000008 103 Query 1 103 use `d1`; COMMIT +master-bin.000008 142 Query 1 142 use `d1`; ALTER TABLE d1.t4 ADD column f2 BIGINT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +7 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000008'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000008 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 6 + 1 +slave-bin.000008 65 Query 1 65 use `d1`; ALTER TABLE d1.t4 ADD column f2 BIGINT + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +describe d1.t4; +Field Type Null Key Default Extra +f1 bigint(20) YES NULL +f2 bigint(20) YES NULL + +-------- switch to slave -------- +describe d1.t4; +Field Type Null Key Default Extra +f1 bigint(20) YES NULL +f2 bigint(20) YES NULL + +-------- switch to master ------- + +######## CREATE TABLE d1.t21 (f1 BIGINT) ENGINE= "InnoDB" ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 7 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +8 +SHOW BINLOG EVENTS IN 'master-bin.000009'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +7 +SHOW BINLOG EVENTS IN 'slave-bin.000009'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +CREATE TABLE d1.t21 (f1 BIGINT) ENGINE= "InnoDB"; +SELECT MAX(f1) FROM t1; +MAX(f1) +8 +SHOW BINLOG EVENTS IN 'master-bin.000009'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000009 4 Query 1 4 use `d1`; BEGIN +master-bin.000009 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 7 + 1 +master-bin.000009 103 Query 1 103 use `d1`; COMMIT +master-bin.000009 142 Query 1 142 use `d1`; CREATE TABLE d1.t21 (f1 BIGINT) ENGINE= "InnoDB" + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +8 +SHOW BINLOG EVENTS IN 'slave-bin.000009'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000009 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 7 + 1 +slave-bin.000009 65 Query 1 65 use `d1`; CREATE TABLE d1.t21 (f1 BIGINT) ENGINE= "InnoDB" + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000009'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000009 4 Query 1 4 use `d1`; BEGIN +master-bin.000009 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 7 + 1 +master-bin.000009 103 Query 1 103 use `d1`; COMMIT +master-bin.000009 142 Query 1 142 use `d1`; CREATE TABLE d1.t21 (f1 BIGINT) ENGINE= "InnoDB" + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +8 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000009'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000009 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 7 + 1 +slave-bin.000009 65 Query 1 65 use `d1`; CREATE TABLE d1.t21 (f1 BIGINT) ENGINE= "InnoDB" + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## TRUNCATE TABLE d1.t7 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 8 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +9 +SHOW BINLOG EVENTS IN 'master-bin.000010'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +8 +SHOW BINLOG EVENTS IN 'slave-bin.000010'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +TRUNCATE TABLE d1.t7; +SELECT MAX(f1) FROM t1; +MAX(f1) +9 +SHOW BINLOG EVENTS IN 'master-bin.000010'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000010 4 Query 1 4 use `d1`; BEGIN +master-bin.000010 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 8 + 1 +master-bin.000010 103 Query 1 103 use `d1`; COMMIT +master-bin.000010 142 Query 1 142 use `d1`; TRUNCATE TABLE d1.t7 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +9 +SHOW BINLOG EVENTS IN 'slave-bin.000010'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000010 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 8 + 1 +slave-bin.000010 65 Query 1 65 use `d1`; TRUNCATE TABLE d1.t7 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000010'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000010 4 Query 1 4 use `d1`; BEGIN +master-bin.000010 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 8 + 1 +master-bin.000010 103 Query 1 103 use `d1`; COMMIT +master-bin.000010 142 Query 1 142 use `d1`; TRUNCATE TABLE d1.t7 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +9 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000010'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000010 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 8 + 1 +slave-bin.000010 65 Query 1 65 use `d1`; TRUNCATE TABLE d1.t7 + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT * FROM d1.t7; +f1 + +-------- switch to slave -------- +SELECT * FROM d1.t7; +f1 + +-------- switch to master ------- + +######## LOCK TABLES d1.t1 WRITE, d1.t8 READ ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 9 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +10 +SHOW BINLOG EVENTS IN 'master-bin.000011'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +9 +SHOW BINLOG EVENTS IN 'slave-bin.000011'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +LOCK TABLES d1.t1 WRITE, d1.t8 READ; +SELECT MAX(f1) FROM t1; +MAX(f1) +10 +SHOW BINLOG EVENTS IN 'master-bin.000011'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000011 4 Query 1 4 use `d1`; BEGIN +master-bin.000011 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 9 + 1 +master-bin.000011 103 Query 1 103 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 +SHOW BINLOG EVENTS IN 'slave-bin.000011'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000011 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 9 + 1 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000011'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000011 4 Query 1 4 use `d1`; BEGIN +master-bin.000011 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 9 + 1 +master-bin.000011 103 Query 1 103 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000011'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000011 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 9 + 1 + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +UNLOCK TABLES; +LOCK TABLES d1.t1 WRITE, d1.t8 READ; + +######## UNLOCK TABLES ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 10 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +11 +SHOW BINLOG EVENTS IN 'master-bin.000012'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +10 +SHOW BINLOG EVENTS IN 'slave-bin.000012'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +UNLOCK TABLES; +SELECT MAX(f1) FROM t1; +MAX(f1) +11 +SHOW BINLOG EVENTS IN 'master-bin.000012'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000012 4 Query 1 4 use `d1`; BEGIN +master-bin.000012 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 10 + 1 +master-bin.000012 104 Query 1 104 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +11 +SHOW BINLOG EVENTS IN 'slave-bin.000012'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000012 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 10 + 1 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000012'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000012 4 Query 1 4 use `d1`; BEGIN +master-bin.000012 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 10 + 1 +master-bin.000012 104 Query 1 104 use `d1`; COMMIT + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +11 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000012'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000012 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 10 + 1 + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- + +######## DROP INDEX my_idx6 ON d1.t6 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 11 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +12 +SHOW BINLOG EVENTS IN 'master-bin.000013'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +11 +SHOW BINLOG EVENTS IN 'slave-bin.000013'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +DROP INDEX my_idx6 ON d1.t6; +SELECT MAX(f1) FROM t1; +MAX(f1) +12 +SHOW BINLOG EVENTS IN 'master-bin.000013'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000013 4 Query 1 4 use `d1`; BEGIN +master-bin.000013 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 11 + 1 +master-bin.000013 104 Query 1 104 use `d1`; COMMIT +master-bin.000013 143 Query 1 143 use `d1`; DROP INDEX my_idx6 ON d1.t6 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +12 +SHOW BINLOG EVENTS IN 'slave-bin.000013'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000013 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 11 + 1 +slave-bin.000013 66 Query 1 66 use `d1`; DROP INDEX my_idx6 ON d1.t6 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +12 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000013'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000013 4 Query 1 4 use `d1`; BEGIN +master-bin.000013 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 11 + 1 +master-bin.000013 104 Query 1 104 use `d1`; COMMIT +master-bin.000013 143 Query 1 143 use `d1`; DROP INDEX my_idx6 ON d1.t6 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +12 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000013'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000013 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 11 + 1 +slave-bin.000013 66 Query 1 66 use `d1`; DROP INDEX my_idx6 ON d1.t6 + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW INDEX FROM d1.t6; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment + +-------- switch to slave -------- +SHOW INDEX FROM d1.t6; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment + +-------- switch to master ------- + +######## CREATE INDEX my_idx5 ON d1.t5(f1) ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 12 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +13 +SHOW BINLOG EVENTS IN 'master-bin.000014'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +12 +SHOW BINLOG EVENTS IN 'slave-bin.000014'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +CREATE INDEX my_idx5 ON d1.t5(f1); +SELECT MAX(f1) FROM t1; +MAX(f1) +13 +SHOW BINLOG EVENTS IN 'master-bin.000014'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000014 4 Query 1 4 use `d1`; BEGIN +master-bin.000014 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 12 + 1 +master-bin.000014 104 Query 1 104 use `d1`; COMMIT +master-bin.000014 143 Query 1 143 use `d1`; CREATE INDEX my_idx5 ON d1.t5(f1) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +13 +SHOW BINLOG EVENTS IN 'slave-bin.000014'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000014 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 12 + 1 +slave-bin.000014 66 Query 1 66 use `d1`; CREATE INDEX my_idx5 ON d1.t5(f1) + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +13 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000014'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000014 4 Query 1 4 use `d1`; BEGIN +master-bin.000014 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 12 + 1 +master-bin.000014 104 Query 1 104 use `d1`; COMMIT +master-bin.000014 143 Query 1 143 use `d1`; CREATE INDEX my_idx5 ON d1.t5(f1) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +13 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000014'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000014 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 12 + 1 +slave-bin.000014 66 Query 1 66 use `d1`; CREATE INDEX my_idx5 ON d1.t5(f1) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW INDEX FROM d1.t5; +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 -------- +SHOW INDEX FROM d1.t5; +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 ------- + +######## DROP DATABASE d2 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 13 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +14 +SHOW BINLOG EVENTS IN 'master-bin.000015'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +13 +SHOW BINLOG EVENTS IN 'slave-bin.000015'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +DROP DATABASE d2; +SELECT MAX(f1) FROM t1; +MAX(f1) +14 +SHOW BINLOG EVENTS IN 'master-bin.000015'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000015 4 Query 1 4 use `d1`; BEGIN +master-bin.000015 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 13 + 1 +master-bin.000015 104 Query 1 104 use `d1`; COMMIT +master-bin.000015 143 Query 1 143 DROP DATABASE d2 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +14 +SHOW BINLOG EVENTS IN 'slave-bin.000015'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000015 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 13 + 1 +slave-bin.000015 66 Query 1 66 DROP DATABASE d2 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +14 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000015'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000015 4 Query 1 4 use `d1`; BEGIN +master-bin.000015 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 13 + 1 +master-bin.000015 104 Query 1 104 use `d1`; COMMIT +master-bin.000015 143 Query 1 143 DROP DATABASE d2 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +14 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000015'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000015 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 13 + 1 +slave-bin.000015 66 Query 1 66 DROP DATABASE d2 + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW DATABASES LIKE "d2"; +Database (d2) + +-------- switch to slave -------- +SHOW DATABASES LIKE "d2"; +Database (d2) + +-------- switch to master ------- + +######## CREATE DATABASE d3 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 14 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +15 +SHOW BINLOG EVENTS IN 'master-bin.000016'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +14 +SHOW BINLOG EVENTS IN 'slave-bin.000016'; +Log_name Pos Event_type Server_id Orig_log_pos Info + +-------- switch to master ------- +CREATE DATABASE d3; +SELECT MAX(f1) FROM t1; +MAX(f1) +15 +SHOW BINLOG EVENTS IN 'master-bin.000016'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000016 4 Query 1 4 use `d1`; BEGIN +master-bin.000016 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 14 + 1 +master-bin.000016 104 Query 1 104 use `d1`; COMMIT +master-bin.000016 143 Query 1 143 CREATE DATABASE d3 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +15 +SHOW BINLOG EVENTS IN 'slave-bin.000016'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000016 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 14 + 1 +slave-bin.000016 66 Query 1 66 CREATE DATABASE d3 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +15 + +TEST-INFO: MASTER: The INSERT is committed +SHOW BINLOG EVENTS IN 'master-bin.000016'; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000016 4 Query 1 4 use `d1`; BEGIN +master-bin.000016 42 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 14 + 1 +master-bin.000016 104 Query 1 104 use `d1`; COMMIT +master-bin.000016 143 Query 1 143 CREATE DATABASE d3 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +15 + +TEST-INFO: SLAVE: The INSERT is committed +SHOW BINLOG EVENTS IN 'slave-bin.000016'; +Log_name Pos Event_type Server_id Orig_log_pos Info +slave-bin.000016 4 Query 1 4 use `d1`; INSERT INTO t1 SET f1= 14 + 1 +slave-bin.000016 66 Query 1 66 CREATE DATABASE d3 + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW DATABASES LIKE "d3"; +Database (d3) +d3 + +-------- switch to slave -------- +SHOW DATABASES LIKE "d3"; +Database (d3) +d3 + +-------- switch to master ------- +DROP DATABASE IF EXISTS d1; +DROP DATABASE IF EXISTS d2; +DROP DATABASE IF EXISTS d3; |