2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
7
DROP TABLE IF EXISTS t1;
8
**** Testing WL#3228 changes. ****
9
*** Create "wider" table on slave ***
22
k enum ('5','6','7', '8','9','0'),
23
l set ('1','2','3','4','5','6','7','8','9','0','11','12','13','14','15','16','17','18','19','21','22','23','24','25','26','27','28','29'),
33
*** Create same table on master but with narrow columns ***
45
l set ('1','2','3','4','5','6','7','8','9','0'),
56
*** Start replication ***
58
*** Insert data on master and display it. ***
59
INSERT INTO t1 () VALUES (
79
SELECT * FROM t1 ORDER BY a;
80
a b c d e f g h j k l m n o p q r s t
81
17.567 2.123 10.20 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
82
*** Select data from slave to compare ***
83
SELECT * FROM t1 ORDER BY a;
84
a b c d e f g h j k l m n o p q r s t
85
17.567 2.123000000 10.200000000000000000000000000000 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
87
Create varchar table on master
94
Alter varchar table on slave
95
ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100);
96
ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(400);
97
ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500);
98
ALTER TABLE t1 CHANGE COLUMN d d CHAR(100);
99
Insert some values and select them on master
100
INSERT INTO t1 VALUES ("This is a test of col a.",
101
"This is another test of col b.",
102
"This is a test of the large col c.",
106
This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
107
SHOW CREATE TABLE t1;
109
t1 CREATE TABLE `t1` (
110
`a` varchar(50) DEFAULT NULL,
111
`b` varchar(100) DEFAULT NULL,
112
`c` varchar(300) DEFAULT NULL,
113
`d` char(5) DEFAULT NULL
114
) ENGINE=MyISAM DEFAULT CHARSET=latin1
115
Insert some values and select them on slave
118
This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
119
SHOW CREATE TABLE t1;
121
t1 CREATE TABLE `t1` (
122
`a` varchar(100) DEFAULT NULL,
123
`b` varchar(400) DEFAULT NULL,
124
`c` varchar(500) DEFAULT NULL,
125
`d` char(100) DEFAULT NULL
126
) ENGINE=MyISAM DEFAULT CHARSET=latin1
128
Create bit table on master
136
Create bit table on slave
145
Insert some values and select them on master
146
INSERT INTO t1 VALUES (
149
b'101010110101010101111',
153
SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
154
BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
155
1010101 10101011 101010110101010101111 10101010101 10101011111
156
SHOW CREATE TABLE t1;
158
t1 CREATE TABLE `t1` (
159
`a` bit(7) DEFAULT NULL,
160
`b` bit(8) DEFAULT NULL,
161
`c` bit(21) DEFAULT NULL,
162
`d` bit(11) DEFAULT NULL,
163
`e` bit(11) DEFAULT NULL
164
) ENGINE=MyISAM DEFAULT CHARSET=latin1
165
Insert some values and select them on master
166
SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
167
BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
168
1010101 10101011 101010110101010101111 10101010101 10101011111
169
SHOW CREATE TABLE t1;
171
t1 CREATE TABLE `t1` (
172
`a` bit(16) DEFAULT NULL,
173
`b` bit(22) DEFAULT NULL,
174
`c` bit(54) DEFAULT NULL,
175
`d` bit(25) DEFAULT NULL,
176
`e` bit(13) DEFAULT NULL
177
) ENGINE=MyISAM DEFAULT CHARSET=latin1