Debian Codegraph @

mysql-test/suite/rpl/t/rpl_alter.test

raw
1 source include/master-slave.inc;
2 create database mysqltest;
3
4 create table mysqltest.t1 ( n int);
5 alter table mysqltest.t1 add m int;
6 insert into mysqltest.t1 values (1,2);
7 create table mysqltest.t2 (n int);
8 insert into mysqltest.t2 values (45);
9 rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2;
10 sync_slave_with_master;
11 select * from mysqltest.t2;
12 select * from mysqltest.t3;
13 connection master;
14 drop database mysqltest;
15 sync_slave_with_master;
16
17 # End of 4.1 tests
18
19 connection master;
20 use test;
21
22 --echo #
23 --echo # Test bug where ALTER TABLE MODIFY didn't replicate properly
24 --echo #
25
26 create table t1 (a int unsigned primary key, b int);
27 show create table t1;
28 insert into t1 (a) values (1),((1<<32)-1);
29 select * from t1;
30 alter table t1 modify a bigint;
31 show create table t1;
32 select * from t1;
33 alter table t1 modify a int unsigned;
34 show create table t1;
35 select * from t1;
36 alter table t1 modify a bigint unsigned;
37 show create table t1;
38 select * from t1;
39 sync_slave_with_master;
40 use test;
41 select * from t1;
42 show create table t1;
43 connection master;
44 #
45 create table t2 (a int unsigned auto_increment primary key, b int);
46 show create table t2;
47 alter table t2 modify a bigint;
48 show create table t2;
49 alter table t2 modify a bigint auto_increment;
50 show create table t2;
51 drop table t1,t2;
52
53 --echo #
54 --echo # MDEV-8432: Slave cannot replicate signed integer-type values
55 --echo # with high bit set to 1
56 --echo # Test replication when we have int on master and bigint on slave
57 --echo #
58
59 create table t1 (a int unsigned primary key, b int);
60 sync_slave_with_master;
61 SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
62 alter table t1 modify a bigint unsigned;
63 connection master;
64 insert into t1 (a) values (1),((1<<32)-1);
65 sync_slave_with_master;
66 select * from t1;
67 SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
68 connection master;
69 drop table t1;
70
71 --source include/rpl_end.inc