1include/master-slave.inc
2[connection master]
3DROP TABLE IF EXISTS t1;
4**** Testing WL#3228 changes. ****
5*** Create "wider" table on slave ***
6connection slave;
7STOP SLAVE;
8include/wait_for_slave_to_stop.inc
9RESET SLAVE;
10SET @saved_slave_type_conversions = @@slave_type_conversions;
11SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
12CREATE TABLE t1 (
13a float     (47),
14b double    (143,9),
15c decimal   (65,30),
16d numeric   (4,0),
17e bit       (32),
18f char      (21),
19g varchar   (1300),
20h binary    (33),
21j varbinary (200),
22k enum      ('5','6','7', '8','9','0'),
23l 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'),
24m TINYBLOB,
25n BLOB,
26o MEDIUMBLOB,
27p LONGBLOB,
28q TINYTEXT,
29r TEXT,
30s MEDIUMTEXT,
31t LONGTEXT
32);
33*** Create same table on master but with narrow columns ***
34connection master;
35CREATE TABLE t1 (
36a float     (44),
37b double    (10,3),
38c decimal   (10,2),
39d numeric   (3,0),
40e bit       (16),
41f char      (10),
42g varchar   (100),
43h binary    (20),
44j varbinary (20),
45k enum      ('5','6','7'),
46l set       ('1','2','3','4','5','6','7','8','9','0'),
47m TINYBLOB,
48n BLOB,
49o MEDIUMBLOB,
50p LONGBLOB,
51q TINYTEXT,
52r TEXT,
53s MEDIUMTEXT,
54t LONGTEXT
55);
56RESET MASTER;
57*** Start replication ***
58connection slave;
59START SLAVE;
60include/wait_for_slave_to_start.inc
61*** Insert data on master and display it. ***
62connection master;
63INSERT INTO t1 () VALUES (
6417.567,
652.123,
6610.20,
67125,
68hex(64),
69'TEST',
70'This is a test',
71'binary data',
72'more binary data',
73'6',
74'7',
75"blob 1",
76"blob  2",
77"blob   3",
78"blob    4",
79"text 1",
80"text  2",
81"text   3",
82"text    4");
83SELECT * FROM t1 ORDER BY a;
84a	b	c	d	e	f	g	h	j	k	l	m	n	o	p	q	r	s	t
8517.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
86*** Select data from slave to compare ***
87connection slave;
88connection slave;
89SELECT * FROM t1 ORDER BY a;
90a	b	c	d	e	f	g	h	j	k	l	m	n	o	p	q	r	s	t
9117.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
92connection master;
93DROP TABLE t1;
94Create varchar table on master
95CREATE TABLE t1 (
96a VARCHAR(50),
97b VARCHAR(100),
98c VARCHAR(300),
99d CHAR(5)
100);
101connection slave;
102Alter varchar table on slave
103ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100);
104ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(400);
105ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500);
106ALTER TABLE t1 CHANGE COLUMN d d CHAR(100);
107connection master;
108Insert some values and select them on master
109INSERT INTO t1 VALUES ("This is a test of col a.",
110"This is another test of col b.",
111"This is a test of the large col c.",
112"Col d");
113SELECT * FROM t1;
114a	b	c	d
115This is a test of col a.	This is another test of col b.	This is a test of the large col c.	Col d
116SHOW CREATE TABLE t1;
117Table	Create Table
118t1	CREATE TABLE `t1` (
119  `a` varchar(50) DEFAULT NULL,
120  `b` varchar(100) DEFAULT NULL,
121  `c` varchar(300) DEFAULT NULL,
122  `d` char(5) DEFAULT NULL
123) ENGINE=MyISAM DEFAULT CHARSET=latin1
124connection slave;
125Insert some values and select them on slave
126SELECT * FROM t1;
127a	b	c	d
128This is a test of col a.	This is another test of col b.	This is a test of the large col c.	Col d
129SHOW CREATE TABLE t1;
130Table	Create Table
131t1	CREATE TABLE `t1` (
132  `a` varchar(100) DEFAULT NULL,
133  `b` varchar(400) DEFAULT NULL,
134  `c` varchar(500) DEFAULT NULL,
135  `d` char(100) DEFAULT NULL
136) ENGINE=MyISAM DEFAULT CHARSET=latin1
137connection master;
138DROP TABLE t1;
139Create bit table on master
140CREATE TABLE t1 (
141a BIT(7),
142b BIT(8),
143c BIT(21),
144d BIT(11),
145e BIT(11)
146);
147connection slave;
148Create bit table on slave
149DROP TABLE t1;
150CREATE TABLE t1 (
151a BIT(16),
152b BIT(22),
153c BIT(54),
154d BIT(25),
155e BIT(13)
156);
157connection master;
158Insert some values and select them on master
159INSERT INTO t1 VALUES (
160b'1010101',
161b'10101011',
162b'101010110101010101111',
163b'10101010101',
164b'10101011111'
165  );
166SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
167BIN(a)	BIN(b)	BIN(c)	BIN(d)	BIN(e)
1681010101	10101011	101010110101010101111	10101010101	10101011111
169SHOW CREATE TABLE t1;
170Table	Create Table
171t1	CREATE TABLE `t1` (
172  `a` bit(7) DEFAULT NULL,
173  `b` bit(8) DEFAULT NULL,
174  `c` bit(21) DEFAULT NULL,
175  `d` bit(11) DEFAULT NULL,
176  `e` bit(11) DEFAULT NULL
177) ENGINE=MyISAM DEFAULT CHARSET=latin1
178connection slave;
179Insert some values and select them on master
180SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
181BIN(a)	BIN(b)	BIN(c)	BIN(d)	BIN(e)
1821010101	10101011	101010110101010101111	10101010101	10101011111
183SHOW CREATE TABLE t1;
184Table	Create Table
185t1	CREATE TABLE `t1` (
186  `a` bit(16) DEFAULT NULL,
187  `b` bit(22) DEFAULT NULL,
188  `c` bit(54) DEFAULT NULL,
189  `d` bit(25) DEFAULT NULL,
190  `e` bit(13) DEFAULT NULL
191) ENGINE=MyISAM DEFAULT CHARSET=latin1
192*** Cleanup  ***
193connection master;
194DROP TABLE t1;
195connection slave;
196SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
197include/rpl_end.inc
198