| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
connection master; |
| 4 |
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; |
| 5 |
set global binlog_alter_two_phase = ON; |
| 6 |
set binlog_alter_two_phase = ON; |
| 7 |
connection slave; |
| 8 |
set global gtid_strict_mode=1; |
| 9 |
connection slave; |
| 10 |
include/stop_slave.inc |
| 11 |
SET GLOBAL slave_parallel_threads=4; |
| 12 |
set global slave_parallel_mode=optimistic; |
| 13 |
change master to master_use_gtid=slave_pos; |
| 14 |
include/start_slave.inc |
| 15 |
# Parallel Slave |
| 16 |
connection master; |
| 17 |
connect master_node,127.0.0.1,root,,$db_name, $M_port; |
| 18 |
connect slave_node,127.0.0.1,root,,test, $S_port; |
| 19 |
# myisam |
| 20 |
connection master_node; |
| 21 |
create table t1(a int, b int) engine=myisam;; |
| 22 |
insert into t1 values(1,1); |
| 23 |
insert into t1 values(2,2); |
| 24 |
# Normal Alter |
| 25 |
alter table t1 add column c int; |
| 26 |
show create table t1; |
| 27 |
Table Create Table |
| 28 |
t1 CREATE TABLE `t1` ( |
| 29 |
`a` int(11) DEFAULT NULL, |
| 30 |
`b` int(11) DEFAULT NULL, |
| 31 |
`c` int(11) DEFAULT NULL |
| 32 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 33 |
# Failed Alter |
| 34 |
insert into t1 values(1,1, NULL); |
| 35 |
alter table t1 change a a int unique; |
| 36 |
ERROR 23000: Duplicate entry '1' for key 'a' |
| 37 |
set @@session.binlog_alter_two_phase = 0; |
| 38 |
alter table t1 change a a int; |
| 39 |
set @@session.binlog_alter_two_phase = 1; |
| 40 |
alter table t1 change a a int; |
| 41 |
show create table t1; |
| 42 |
Table Create Table |
| 43 |
t1 CREATE TABLE `t1` ( |
| 44 |
`a` int(11) DEFAULT NULL, |
| 45 |
`b` int(11) DEFAULT NULL, |
| 46 |
`c` int(11) DEFAULT NULL |
| 47 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 48 |
include/save_master_gtid.inc |
| 49 |
connection slave_node; |
| 50 |
include/sync_with_master_gtid.inc |
| 51 |
show create table t1; |
| 52 |
Table Create Table |
| 53 |
t1 CREATE TABLE `t1` ( |
| 54 |
`a` int(11) DEFAULT NULL, |
| 55 |
`b` int(11) DEFAULT NULL, |
| 56 |
`c` int(11) DEFAULT NULL |
| 57 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 58 |
connection master_node; |
| 59 |
drop table t1; |
| 60 |
include/save_master_gtid.inc |
| 61 |
connection slave_node; |
| 62 |
include/sync_with_master_gtid.inc |
| 63 |
# innodb |
| 64 |
connection master_node; |
| 65 |
create table t1(a int, b int) engine=innodb;; |
| 66 |
insert into t1 values(1,1); |
| 67 |
insert into t1 values(2,2); |
| 68 |
# Normal Alter |
| 69 |
alter table t1 add column c int; |
| 70 |
show create table t1; |
| 71 |
Table Create Table |
| 72 |
t1 CREATE TABLE `t1` ( |
| 73 |
`a` int(11) DEFAULT NULL, |
| 74 |
`b` int(11) DEFAULT NULL, |
| 75 |
`c` int(11) DEFAULT NULL |
| 76 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 77 |
# Failed Alter |
| 78 |
insert into t1 values(1,1, NULL); |
| 79 |
alter table t1 change a a int unique; |
| 80 |
ERROR 23000: Duplicate entry '1' for key 'a' |
| 81 |
set @@session.binlog_alter_two_phase = 0; |
| 82 |
alter table t1 change a a int; |
| 83 |
set @@session.binlog_alter_two_phase = 1; |
| 84 |
alter table t1 change a a int; |
| 85 |
show create table t1; |
| 86 |
Table Create Table |
| 87 |
t1 CREATE TABLE `t1` ( |
| 88 |
`a` int(11) DEFAULT NULL, |
| 89 |
`b` int(11) DEFAULT NULL, |
| 90 |
`c` int(11) DEFAULT NULL |
| 91 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 92 |
include/save_master_gtid.inc |
| 93 |
connection slave_node; |
| 94 |
include/sync_with_master_gtid.inc |
| 95 |
show create table t1; |
| 96 |
Table Create Table |
| 97 |
t1 CREATE TABLE `t1` ( |
| 98 |
`a` int(11) DEFAULT NULL, |
| 99 |
`b` int(11) DEFAULT NULL, |
| 100 |
`c` int(11) DEFAULT NULL |
| 101 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 102 |
connection master_node; |
| 103 |
drop table t1; |
| 104 |
include/save_master_gtid.inc |
| 105 |
connection slave_node; |
| 106 |
include/sync_with_master_gtid.inc |
| 107 |
# aria |
| 108 |
connection master_node; |
| 109 |
create table t1(a int, b int) engine=aria;; |
| 110 |
insert into t1 values(1,1); |
| 111 |
insert into t1 values(2,2); |
| 112 |
# Normal Alter |
| 113 |
alter table t1 add column c int; |
| 114 |
show create table t1; |
| 115 |
Table Create Table |
| 116 |
t1 CREATE TABLE `t1` ( |
| 117 |
`a` int(11) DEFAULT NULL, |
| 118 |
`b` int(11) DEFAULT NULL, |
| 119 |
`c` int(11) DEFAULT NULL |
| 120 |
) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci PAGE_CHECKSUM=1 |
| 121 |
# Failed Alter |
| 122 |
insert into t1 values(1,1, NULL); |
| 123 |
alter table t1 change a a int unique; |
| 124 |
ERROR 23000: Duplicate entry '1' for key 'a' |
| 125 |
set @@session.binlog_alter_two_phase = 0; |
| 126 |
alter table t1 change a a int; |
| 127 |
set @@session.binlog_alter_two_phase = 1; |
| 128 |
alter table t1 change a a int; |
| 129 |
show create table t1; |
| 130 |
Table Create Table |
| 131 |
t1 CREATE TABLE `t1` ( |
| 132 |
`a` int(11) DEFAULT NULL, |
| 133 |
`b` int(11) DEFAULT NULL, |
| 134 |
`c` int(11) DEFAULT NULL |
| 135 |
) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci PAGE_CHECKSUM=1 |
| 136 |
include/save_master_gtid.inc |
| 137 |
connection slave_node; |
| 138 |
include/sync_with_master_gtid.inc |
| 139 |
show create table t1; |
| 140 |
Table Create Table |
| 141 |
t1 CREATE TABLE `t1` ( |
| 142 |
`a` int(11) DEFAULT NULL, |
| 143 |
`b` int(11) DEFAULT NULL, |
| 144 |
`c` int(11) DEFAULT NULL |
| 145 |
) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci PAGE_CHECKSUM=1 |
| 146 |
connection master_node; |
| 147 |
drop table t1; |
| 148 |
include/save_master_gtid.inc |
| 149 |
connection slave_node; |
| 150 |
include/sync_with_master_gtid.inc |
| 151 |
# concurrent alter Myisam |
| 152 |
# Sync slave |
| 153 |
include/save_master_gtid.inc |
| 154 |
include/sync_with_master_gtid.inc |
| 155 |
# Sync slave |
| 156 |
include/save_master_gtid.inc |
| 157 |
include/sync_with_master_gtid.inc |
| 158 |
# Concurrent DML |
| 159 |
# Sync slave |
| 160 |
include/save_master_gtid.inc |
| 161 |
include/sync_with_master_gtid.inc |
| 162 |
# Rollback tests |
| 163 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 164 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 165 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 166 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 167 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 168 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 169 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 170 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 171 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 172 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 173 |
# Sync slave |
| 174 |
include/save_master_gtid.inc |
| 175 |
include/sync_with_master_gtid.inc |
| 176 |
# diff_table of master and slave , we will do only in the case when |
| 177 |
# sync_slave is on |
| 178 |
include/diff_tables.inc [master_node:t1, slave_node:t1] |
| 179 |
include/diff_tables.inc [master_node:t2, slave_node:t2] |
| 180 |
include/diff_tables.inc [master_node:t3, slave_node:t3] |
| 181 |
include/diff_tables.inc [master_node:t4, slave_node:t4] |
| 182 |
include/diff_tables.inc [master_node:t5, slave_node:t5] |
| 183 |
include/diff_tables.inc [master_node:t6, slave_node:t6] |
| 184 |
include/diff_tables.inc [master_node:t7, slave_node:t7] |
| 185 |
include/diff_tables.inc [master_node:t8, slave_node:t8] |
| 186 |
include/diff_tables.inc [master_node:t9, slave_node:t9] |
| 187 |
include/diff_tables.inc [master_node:t10, slave_node:t10] |
| 188 |
# Sync slave |
| 189 |
include/save_master_gtid.inc |
| 190 |
include/sync_with_master_gtid.inc |
| 191 |
# concurrent alter Aria |
| 192 |
# Sync slave |
| 193 |
include/save_master_gtid.inc |
| 194 |
include/sync_with_master_gtid.inc |
| 195 |
# Sync slave |
| 196 |
include/save_master_gtid.inc |
| 197 |
include/sync_with_master_gtid.inc |
| 198 |
# Concurrent DML |
| 199 |
# Sync slave |
| 200 |
include/save_master_gtid.inc |
| 201 |
include/sync_with_master_gtid.inc |
| 202 |
# Rollback tests |
| 203 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 204 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 205 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 206 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 207 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 208 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 209 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 210 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 211 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 212 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 213 |
# Sync slave |
| 214 |
include/save_master_gtid.inc |
| 215 |
include/sync_with_master_gtid.inc |
| 216 |
# diff_table of master and slave , we will do only in the case when |
| 217 |
# sync_slave is on |
| 218 |
include/diff_tables.inc [master_node:t1, slave_node:t1] |
| 219 |
include/diff_tables.inc [master_node:t2, slave_node:t2] |
| 220 |
include/diff_tables.inc [master_node:t3, slave_node:t3] |
| 221 |
include/diff_tables.inc [master_node:t4, slave_node:t4] |
| 222 |
include/diff_tables.inc [master_node:t5, slave_node:t5] |
| 223 |
include/diff_tables.inc [master_node:t6, slave_node:t6] |
| 224 |
include/diff_tables.inc [master_node:t7, slave_node:t7] |
| 225 |
include/diff_tables.inc [master_node:t8, slave_node:t8] |
| 226 |
include/diff_tables.inc [master_node:t9, slave_node:t9] |
| 227 |
include/diff_tables.inc [master_node:t10, slave_node:t10] |
| 228 |
# Sync slave |
| 229 |
include/save_master_gtid.inc |
| 230 |
include/sync_with_master_gtid.inc |
| 231 |
# concurrent alter Innodb copy |
| 232 |
# Sync slave |
| 233 |
include/save_master_gtid.inc |
| 234 |
include/sync_with_master_gtid.inc |
| 235 |
# Sync slave |
| 236 |
include/save_master_gtid.inc |
| 237 |
include/sync_with_master_gtid.inc |
| 238 |
# Concurrent DML |
| 239 |
# Sync slave |
| 240 |
include/save_master_gtid.inc |
| 241 |
include/sync_with_master_gtid.inc |
| 242 |
# Rollback tests |
| 243 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 244 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 245 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 246 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 247 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 248 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 249 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 250 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 251 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 252 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 253 |
# Sync slave |
| 254 |
include/save_master_gtid.inc |
| 255 |
include/sync_with_master_gtid.inc |
| 256 |
# diff_table of master and slave , we will do only in the case when |
| 257 |
# sync_slave is on |
| 258 |
include/diff_tables.inc [master_node:t1, slave_node:t1] |
| 259 |
include/diff_tables.inc [master_node:t2, slave_node:t2] |
| 260 |
include/diff_tables.inc [master_node:t3, slave_node:t3] |
| 261 |
include/diff_tables.inc [master_node:t4, slave_node:t4] |
| 262 |
include/diff_tables.inc [master_node:t5, slave_node:t5] |
| 263 |
include/diff_tables.inc [master_node:t6, slave_node:t6] |
| 264 |
include/diff_tables.inc [master_node:t7, slave_node:t7] |
| 265 |
include/diff_tables.inc [master_node:t8, slave_node:t8] |
| 266 |
include/diff_tables.inc [master_node:t9, slave_node:t9] |
| 267 |
include/diff_tables.inc [master_node:t10, slave_node:t10] |
| 268 |
# Sync slave |
| 269 |
include/save_master_gtid.inc |
| 270 |
include/sync_with_master_gtid.inc |
| 271 |
# concurrent alter Innodb Inplace |
| 272 |
# Sync slave |
| 273 |
include/save_master_gtid.inc |
| 274 |
include/sync_with_master_gtid.inc |
| 275 |
# Sync slave |
| 276 |
include/save_master_gtid.inc |
| 277 |
include/sync_with_master_gtid.inc |
| 278 |
# Concurrent DML |
| 279 |
# Sync slave |
| 280 |
include/save_master_gtid.inc |
| 281 |
include/sync_with_master_gtid.inc |
| 282 |
# Sync slave |
| 283 |
include/save_master_gtid.inc |
| 284 |
include/sync_with_master_gtid.inc |
| 285 |
# Rollback tests |
| 286 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 287 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 288 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 289 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 290 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 291 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 292 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 293 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 294 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 295 |
ERROR 23000: Duplicate entry '2' for key 'b' |
| 296 |
# Sync slave |
| 297 |
include/save_master_gtid.inc |
| 298 |
include/sync_with_master_gtid.inc |
| 299 |
# diff_table of master and slave , we will do only in the case when |
| 300 |
# sync_slave is on |
| 301 |
include/diff_tables.inc [master_node:t1, slave_node:t1] |
| 302 |
include/diff_tables.inc [master_node:t2, slave_node:t2] |
| 303 |
include/diff_tables.inc [master_node:t3, slave_node:t3] |
| 304 |
include/diff_tables.inc [master_node:t4, slave_node:t4] |
| 305 |
include/diff_tables.inc [master_node:t5, slave_node:t5] |
| 306 |
include/diff_tables.inc [master_node:t6, slave_node:t6] |
| 307 |
include/diff_tables.inc [master_node:t7, slave_node:t7] |
| 308 |
include/diff_tables.inc [master_node:t8, slave_node:t8] |
| 309 |
include/diff_tables.inc [master_node:t9, slave_node:t9] |
| 310 |
include/diff_tables.inc [master_node:t10, slave_node:t10] |
| 311 |
# Sync slave |
| 312 |
include/save_master_gtid.inc |
| 313 |
include/sync_with_master_gtid.inc |
| 314 |
connection master; |
| 315 |
include/save_master_gtid.inc |
| 316 |
connection slave; |
| 317 |
include/sync_with_master_gtid.inc |
| 318 |
# cleanup |
| 319 |
include/stop_slave.inc |
| 320 |
set global slave_parallel_threads = 0;; |
| 321 |
set global slave_parallel_mode = optimistic;; |
| 322 |
set global gtid_strict_mode = 0;; |
| 323 |
set global gtid_domain_id= 0; |
| 324 |
include/start_slave.inc |
| 325 |
connection master; |
| 326 |
set global binlog_alter_two_phase=0;; |
| 327 |
include/rpl_end.inc |