Debian Codegraph @

mysql-test/suite/rpl/r/rpl_start_alter_chain_basic.result

raw
1 include/rpl_init.inc [topology=1->2->3->4]
2 connection server_3;
3 set global gtid_strict_mode=1;
4 include/stop_slave.inc
5 SET GLOBAL slave_parallel_threads=10;
6 set global slave_parallel_mode=optimistic;
7 change master to master_use_gtid=slave_pos;
8 include/start_slave.inc
9 connection server_1;
10 set global binlog_alter_two_phase=ON;
11 set binlog_alter_two_phase=ON;
12 connect master_node,127.0.0.1,root,,$db_name, $SERVER_MYPORT_1;
13 connect slave_node,127.0.0.1,root,,test, $SERVER_MYPORT_2;
14 # innodb
15 connection master_node;
16 create table t1(a int, b int) engine=innodb;;
17 insert into t1 values(1,1);
18 insert into t1 values(2,2);
19 # Normal Alter
20 alter table t1 add column c int;
21 show create table t1;
22 Table Create Table
23 t1 CREATE TABLE `t1` (
24 `a` int(11) DEFAULT NULL,
25 `b` int(11) DEFAULT NULL,
26 `c` int(11) DEFAULT NULL
27 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
28 # Failed Alter
29 insert into t1 values(1,1, NULL);
30 alter table t1 change a a int unique;
31 ERROR 23000: Duplicate entry '1' for key 'a'
32 set @@session.binlog_alter_two_phase = 0;
33 alter table t1 change a a int;
34 set @@session.binlog_alter_two_phase = 1;
35 alter table t1 change a a int;
36 show create table t1;
37 Table Create Table
38 t1 CREATE TABLE `t1` (
39 `a` int(11) DEFAULT NULL,
40 `b` int(11) DEFAULT NULL,
41 `c` int(11) DEFAULT NULL
42 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
43 include/save_master_gtid.inc
44 connection slave_node;
45 include/sync_with_master_gtid.inc
46 show create table t1;
47 Table Create Table
48 t1 CREATE TABLE `t1` (
49 `a` int(11) DEFAULT NULL,
50 `b` int(11) DEFAULT NULL,
51 `c` int(11) DEFAULT NULL
52 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
53 connection master_node;
54 drop table t1;
55 include/save_master_gtid.inc
56 connection slave_node;
57 include/sync_with_master_gtid.inc
58 disconnect master_node;
59 disconnect slave_node;
60 connection server_1;
61 set global binlog_alter_two_phase=0;
62 include/rpl_sync.inc
63 connection server_2;
64 select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
65 domain_id seq_no
66 0 12
67 connection server_1;
68 include/save_master_gtid.inc
69 connection server_3;
70 include/sync_with_master_gtid.inc
71 select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
72 domain_id seq_no
73 0 12
74 include/stop_slave.inc
75 set global slave_parallel_threads = 0;;
76 set global slave_parallel_mode = optimistic;;
77 set global gtid_strict_mode = 0;;
78 include/start_slave.inc
79 select @@slave_parallel_threads;
80 @@slave_parallel_threads
81 0
82 connection server_4;
83 include/sync_with_master_gtid.inc
84 select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
85 domain_id seq_no
86 0 12
87 include/rpl_end.inc