blob: 576a72eb55f00d3823a3118ad1d647d50b700405 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1);
INSERT INTO t2 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT COUNT(*) = 2 FROM t2;
COUNT(*) = 2
1
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
FLUSH LOGS;
SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,18;
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000002 # Gtid # # GTID 0-1-1
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-2
mysqld-bin.000002 # Table_map # # table_id: # (test.t1)
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # GTID 0-1-3
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-4
mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-5
mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # GTID 0-1-6
mysqld-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
connection node_2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,18;
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-bin.000003 # Gtid # # GTID 0-1-1
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-2
mysqld-bin.000003 # Table_map # # table_id: # (test.t1)
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
mysqld-bin.000003 # Gtid # # GTID 0-1-3
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-4
mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-5
mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
mysqld-bin.000003 # Gtid # # GTID 0-1-6
mysqld-bin.000003 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
DROP TABLE t1;
DROP TABLE t2;
connection node_1;
RESET MASTER;
|