summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/r/rpl_alter.result
blob: 608526ea79f20d3529f978203c8c68b8643220a5 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
include/master-slave.inc
[connection master]
create database mysqltest;
create table mysqltest.t1 ( n int);
alter table mysqltest.t1 add m int;
insert into mysqltest.t1 values (1,2);
create table mysqltest.t2 (n int);
insert into mysqltest.t2 values (45);
rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2;
select * from mysqltest.t2;
n	m
1	2
select * from mysqltest.t3;
n
45
drop database mysqltest;
use test;
#
# Test bug where ALTER TABLE MODIFY didn't replicate properly
#
create table t1 (a int unsigned primary key, b int);
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(10) unsigned NOT NULL,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 (a) values (1),((1<<32)-1);
select * from t1;
a	b
1	NULL
4294967295	NULL
alter table t1 modify a bigint;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bigint(20) NOT NULL,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
a	b
1	NULL
4294967295	NULL
alter table t1 modify a int unsigned;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(10) unsigned NOT NULL,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
a	b
1	NULL
4294967295	NULL
alter table t1 modify a bigint unsigned;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bigint(20) unsigned NOT NULL,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
a	b
1	NULL
4294967295	NULL
use test;
select * from t1;
a	b
1	NULL
4294967295	NULL
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bigint(20) unsigned NOT NULL,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create table t2 (a int unsigned auto_increment primary key, b int);
show create table t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `a` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t2 modify a bigint;
show create table t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `a` bigint(20) NOT NULL,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t2 modify a bigint auto_increment;
show create table t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `a` bigint(20) NOT NULL AUTO_INCREMENT,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
#
# MDEV-8432:  Slave cannot replicate signed integer-type values
# with high bit set to 1
# Test replication when we have int on master and bigint on slave
#
create table t1 (a int unsigned primary key, b int);
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
alter table t1 modify a bigint unsigned;
insert into t1 (a) values (1),((1<<32)-1);
select * from t1;
a	b
1	NULL
4294967295	NULL
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
drop table t1;
include/rpl_end.inc