1include/master-slave.inc
2[connection master]
3set @@global.slave_exec_mode= 'IDEMPOTENT';
4CREATE TABLE mysql.ndb_apply_status
5( server_id INT UNSIGNED NOT NULL,
6epoch BIGINT UNSIGNED NOT NULL,
7log_name VARCHAR(255) BINARY NOT NULL,
8start_pos BIGINT UNSIGNED NOT NULL,
9end_pos BIGINT UNSIGNED NOT NULL,
10PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
11--- Doing pre test cleanup ---
12DROP TABLE IF EXISTS t1;
13--- Start test 1 Basic testing ---
14--- Create Table Section ---
15CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
16bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
17f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
18y YEAR, t DATE,PRIMARY KEY(id));
19--- Show table on master ---
20SHOW CREATE TABLE t1;
21Table	Create Table
22t1	CREATE TABLE `t1` (
23  `id` mediumint(9) NOT NULL,
24  `b1` bit(8) DEFAULT NULL,
25  `vc` varchar(255) DEFAULT NULL,
26  `bc` char(255) DEFAULT NULL,
27  `d` decimal(10,4) DEFAULT '0.0000',
28  `f` float DEFAULT '0',
29  `total` bigint(20) unsigned DEFAULT NULL,
30  `y` year(4) DEFAULT NULL,
31  `t` date DEFAULT NULL,
32  PRIMARY KEY (`id`)
33) ENGINE=ndbcluster DEFAULT CHARSET=latin1
34--- Show table on slave ---
35SHOW CREATE TABLE t1;
36Table	Create Table
37t1	CREATE TABLE `t1` (
38  `id` mediumint(9) NOT NULL,
39  `b1` bit(8) DEFAULT NULL,
40  `vc` varchar(255) DEFAULT NULL,
41  `bc` char(255) DEFAULT NULL,
42  `d` decimal(10,4) DEFAULT '0.0000',
43  `f` float DEFAULT '0',
44  `total` bigint(20) unsigned DEFAULT NULL,
45  `y` year(4) DEFAULT NULL,
46  `t` date DEFAULT NULL,
47  PRIMARY KEY (`id`)
48) ENGINE=MyISAM DEFAULT CHARSET=latin1
49--- Perform basic operation on master ---
50--- and ensure replicated correctly ---
51"--- Insert into t1 --" as "";
52--- Select from t1 on master ---
53select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
54id	hex(b1)	vc	bc	d	f	total	y	t
552	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
564	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
5742	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
58142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
59412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
60--- Select from t1 on slave ---
61select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
62id	hex(b1)	vc	bc	d	f	total	y	t
632	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
644	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
6542	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
66142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
67412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
68--- Update t1 on master --
69UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
70--- Check the update on master ---
71SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
72id	hex(b1)	vc	bc	d	f	total	y	t
73412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
74--- Check Update on slave ---
75SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
76id	hex(b1)	vc	bc	d	f	total	y	t
77412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
78--- Remove a record from t1 on master ---
79DELETE FROM t1 WHERE id = 42;
80--- Show current count on master for t1 ---
81SELECT COUNT(*) FROM t1;
82COUNT(*)
834
84--- Show current count on slave for t1 ---
85SELECT COUNT(*) FROM t1;
86COUNT(*)
874
88DELETE FROM t1;
89--- Check that simple Alter statements are replicated correctly --
90ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
91ALTER TABLE t1 MODIFY vc TEXT;
92--- Show the new improved table on the master ---
93SHOW CREATE TABLE t1;
94Table	Create Table
95t1	CREATE TABLE `t1` (
96  `id` mediumint(9) NOT NULL,
97  `b1` bit(8) DEFAULT NULL,
98  `vc` text,
99  `bc` char(255) DEFAULT NULL,
100  `d` decimal(10,4) DEFAULT '0.0000',
101  `f` float DEFAULT '0',
102  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
103  `y` year(4) DEFAULT NULL,
104  `t` date DEFAULT NULL,
105  PRIMARY KEY (`id`,`total`)
106) ENGINE=ndbcluster DEFAULT CHARSET=latin1
107--- Make sure that our tables on slave are still same engine ---
108--- and that the alter statements replicated correctly ---
109SHOW CREATE TABLE t1;
110Table	Create Table
111t1	CREATE TABLE `t1` (
112  `id` mediumint(9) NOT NULL,
113  `b1` bit(8) DEFAULT NULL,
114  `vc` text,
115  `bc` char(255) DEFAULT NULL,
116  `d` decimal(10,4) DEFAULT '0.0000',
117  `f` float DEFAULT '0',
118  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
119  `y` year(4) DEFAULT NULL,
120  `t` date DEFAULT NULL,
121  PRIMARY KEY (`id`,`total`)
122) ENGINE=MyISAM DEFAULT CHARSET=latin1
123--- Perform basic operation on master ---
124--- and ensure replicated correctly ---
125"--- Insert into t1 --" as "";
126--- Select from t1 on master ---
127select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
128id	hex(b1)	vc	bc	d	f	total	y	t
1292	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
1304	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
13142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
132142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
133412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
134--- Select from t1 on slave ---
135select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
136id	hex(b1)	vc	bc	d	f	total	y	t
1372	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
1384	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
13942	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
140142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
141412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
142--- Update t1 on master --
143UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
144--- Check the update on master ---
145SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
146id	hex(b1)	vc	bc	d	f	total	y	t
147412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
148--- Check Update on slave ---
149SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
150id	hex(b1)	vc	bc	d	f	total	y	t
151412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
152--- Remove a record from t1 on master ---
153DELETE FROM t1 WHERE id = 42;
154--- Show current count on master for t1 ---
155SELECT COUNT(*) FROM t1;
156COUNT(*)
1574
158--- Show current count on slave for t1 ---
159SELECT COUNT(*) FROM t1;
160COUNT(*)
1614
162DELETE FROM t1;
163--- End test 1 Basic testing ---
164--- Do Cleanup --
165DROP TABLE IF EXISTS t1;
166--- Start test 2 partition RANGE testing --
167--- Do setup --
168CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
169bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
170f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
171y YEAR, t DATE, primary key(t))
172PARTITION BY RANGE (YEAR(t))
173(PARTITION p0 VALUES LESS THAN (1901),
174PARTITION p1 VALUES LESS THAN (1946),
175PARTITION p2 VALUES LESS THAN (1966),
176PARTITION p3 VALUES LESS THAN (1986),
177PARTITION p4 VALUES LESS THAN (2005),
178PARTITION p5 VALUES LESS THAN MAXVALUE);
179--- Show table on master ---
180SHOW CREATE TABLE t1;
181Table	Create Table
182t1	CREATE TABLE `t1` (
183  `id` mediumint(9) NOT NULL,
184  `b1` bit(8) DEFAULT NULL,
185  `vc` varchar(255) DEFAULT NULL,
186  `bc` char(255) DEFAULT NULL,
187  `d` decimal(10,4) DEFAULT '0.0000',
188  `f` float DEFAULT '0',
189  `total` bigint(20) unsigned DEFAULT NULL,
190  `y` year(4) DEFAULT NULL,
191  `t` date NOT NULL DEFAULT '0000-00-00',
192  PRIMARY KEY (`t`)
193) ENGINE=ndbcluster DEFAULT CHARSET=latin1
194/*!50100 PARTITION BY RANGE (YEAR(t))
195(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
196 PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
197 PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
198 PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
199 PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
200 PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
201--- Show table on slave --
202SHOW CREATE TABLE t1;
203Table	Create Table
204t1	CREATE TABLE `t1` (
205  `id` mediumint(9) NOT NULL,
206  `b1` bit(8) DEFAULT NULL,
207  `vc` varchar(255) DEFAULT NULL,
208  `bc` char(255) DEFAULT NULL,
209  `d` decimal(10,4) DEFAULT '0.0000',
210  `f` float DEFAULT '0',
211  `total` bigint(20) unsigned DEFAULT NULL,
212  `y` year(4) DEFAULT NULL,
213  `t` date NOT NULL DEFAULT '0000-00-00',
214  PRIMARY KEY (`t`)
215) ENGINE=MyISAM DEFAULT CHARSET=latin1
216/*!50100 PARTITION BY RANGE (YEAR(t))
217(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
218 PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
219 PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
220 PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
221 PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
222 PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
223--- Perform basic operation on master ---
224--- and ensure replicated correctly ---
225"--- Insert into t1 --" as "";
226--- Select from t1 on master ---
227select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
228id	hex(b1)	vc	bc	d	f	total	y	t
2292	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
2304	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
23142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
232142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
233412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
234--- Select from t1 on slave ---
235select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
236id	hex(b1)	vc	bc	d	f	total	y	t
2372	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
2384	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
23942	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
240142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
241412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
242--- Update t1 on master --
243UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
244--- Check the update on master ---
245SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
246id	hex(b1)	vc	bc	d	f	total	y	t
247412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
248--- Check Update on slave ---
249SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
250id	hex(b1)	vc	bc	d	f	total	y	t
251412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
252--- Remove a record from t1 on master ---
253DELETE FROM t1 WHERE id = 42;
254--- Show current count on master for t1 ---
255SELECT COUNT(*) FROM t1;
256COUNT(*)
2574
258--- Show current count on slave for t1 ---
259SELECT COUNT(*) FROM t1;
260COUNT(*)
2614
262DELETE FROM t1;
263--- Check that simple Alter statements are replicated correctly ---
264ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(t, id);
265ALTER TABLE t1 MODIFY vc TEXT;
266--- Show the new improved table on the master ---
267SHOW CREATE TABLE t1;
268Table	Create Table
269t1	CREATE TABLE `t1` (
270  `id` mediumint(9) NOT NULL,
271  `b1` bit(8) DEFAULT NULL,
272  `vc` text,
273  `bc` char(255) DEFAULT NULL,
274  `d` decimal(10,4) DEFAULT '0.0000',
275  `f` float DEFAULT '0',
276  `total` bigint(20) unsigned DEFAULT NULL,
277  `y` year(4) DEFAULT NULL,
278  `t` date NOT NULL DEFAULT '0000-00-00',
279  PRIMARY KEY (`t`,`id`)
280) ENGINE=ndbcluster DEFAULT CHARSET=latin1
281/*!50100 PARTITION BY RANGE (YEAR(t))
282(PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
283 PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
284 PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
285 PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
286 PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
287 PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
288--- Make sure that our tables on slave are still same engine ---
289--- and that the alter statements replicated correctly ---
290SHOW CREATE TABLE t1;
291Table	Create Table
292t1	CREATE TABLE `t1` (
293  `id` mediumint(9) NOT NULL,
294  `b1` bit(8) DEFAULT NULL,
295  `vc` text,
296  `bc` char(255) DEFAULT NULL,
297  `d` decimal(10,4) DEFAULT '0.0000',
298  `f` float DEFAULT '0',
299  `total` bigint(20) unsigned DEFAULT NULL,
300  `y` year(4) DEFAULT NULL,
301  `t` date NOT NULL DEFAULT '0000-00-00',
302  PRIMARY KEY (`t`,`id`)
303) ENGINE=MyISAM DEFAULT CHARSET=latin1
304/*!50100 PARTITION BY RANGE (YEAR(t))
305(PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM,
306 PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM,
307 PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM,
308 PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
309 PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
310 PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
311--- Perform basic operation on master ---
312--- and ensure replicated correctly ---
313"--- Insert into t1 --" as "";
314--- Select from t1 on master ---
315select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
316id	hex(b1)	vc	bc	d	f	total	y	t
3172	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
3184	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
31942	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
320142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
321412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
322--- Select from t1 on slave ---
323select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
324id	hex(b1)	vc	bc	d	f	total	y	t
3252	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
3264	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
32742	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
328142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
329412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
330--- Update t1 on master --
331UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
332--- Check the update on master ---
333SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
334id	hex(b1)	vc	bc	d	f	total	y	t
335412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
336--- Check Update on slave ---
337SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
338id	hex(b1)	vc	bc	d	f	total	y	t
339412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
340--- Remove a record from t1 on master ---
341DELETE FROM t1 WHERE id = 42;
342--- Show current count on master for t1 ---
343SELECT COUNT(*) FROM t1;
344COUNT(*)
3454
346--- Show current count on slave for t1 ---
347SELECT COUNT(*) FROM t1;
348COUNT(*)
3494
350DELETE FROM t1;
351--- End test 2 partition RANGE testing ---
352--- Do Cleanup ---
353DROP TABLE IF EXISTS t1;
354--- Start test 3 partition LIST testing ---
355--- Do setup ---
356CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
357bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
358f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
359y YEAR, t DATE, primary key(id))
360PARTITION BY LIST(id)
361(PARTITION p0 VALUES IN (2, 4),
362PARTITION p1 VALUES IN (42, 142));
363--- Test 3 Alter to add partition ---
364ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
365--- Show table on master ---
366SHOW CREATE TABLE t1;
367Table	Create Table
368t1	CREATE TABLE `t1` (
369  `id` mediumint(9) NOT NULL,
370  `b1` bit(8) DEFAULT NULL,
371  `vc` varchar(255) DEFAULT NULL,
372  `bc` char(255) DEFAULT NULL,
373  `d` decimal(10,4) DEFAULT '0.0000',
374  `f` float DEFAULT '0',
375  `total` bigint(20) unsigned DEFAULT NULL,
376  `y` year(4) DEFAULT NULL,
377  `t` date DEFAULT NULL,
378  PRIMARY KEY (`id`)
379) ENGINE=ndbcluster DEFAULT CHARSET=latin1
380/*!50100 PARTITION BY LIST (id)
381(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
382 PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
383 PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
384--- Show table on slave ---
385SHOW CREATE TABLE t1;
386Table	Create Table
387t1	CREATE TABLE `t1` (
388  `id` mediumint(9) NOT NULL,
389  `b1` bit(8) DEFAULT NULL,
390  `vc` varchar(255) DEFAULT NULL,
391  `bc` char(255) DEFAULT NULL,
392  `d` decimal(10,4) DEFAULT '0.0000',
393  `f` float DEFAULT '0',
394  `total` bigint(20) unsigned DEFAULT NULL,
395  `y` year(4) DEFAULT NULL,
396  `t` date DEFAULT NULL,
397  PRIMARY KEY (`id`)
398) ENGINE=MyISAM DEFAULT CHARSET=latin1
399/*!50100 PARTITION BY LIST (id)
400(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
401 PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
402 PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
403--- Perform basic operation on master ---
404--- and ensure replicated correctly ---
405"--- Insert into t1 --" as "";
406--- Select from t1 on master ---
407select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
408id	hex(b1)	vc	bc	d	f	total	y	t
4092	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
4104	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
41142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
412142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
413412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
414--- Select from t1 on slave ---
415select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
416id	hex(b1)	vc	bc	d	f	total	y	t
4172	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
4184	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
41942	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
420142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
421412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
422--- Update t1 on master --
423UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
424--- Check the update on master ---
425SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
426id	hex(b1)	vc	bc	d	f	total	y	t
427412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
428--- Check Update on slave ---
429SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
430id	hex(b1)	vc	bc	d	f	total	y	t
431412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
432--- Remove a record from t1 on master ---
433DELETE FROM t1 WHERE id = 42;
434--- Show current count on master for t1 ---
435SELECT COUNT(*) FROM t1;
436COUNT(*)
4374
438--- Show current count on slave for t1 ---
439SELECT COUNT(*) FROM t1;
440COUNT(*)
4414
442DELETE FROM t1;
443--- Check that simple Alter statements are replicated correctly ---
444ALTER TABLE t1 MODIFY vc TEXT;
445--- Show the new improved table on the master ---
446SHOW CREATE TABLE t1;
447Table	Create Table
448t1	CREATE TABLE `t1` (
449  `id` mediumint(9) NOT NULL,
450  `b1` bit(8) DEFAULT NULL,
451  `vc` text,
452  `bc` char(255) DEFAULT NULL,
453  `d` decimal(10,4) DEFAULT '0.0000',
454  `f` float DEFAULT '0',
455  `total` bigint(20) unsigned DEFAULT NULL,
456  `y` year(4) DEFAULT NULL,
457  `t` date DEFAULT NULL,
458  PRIMARY KEY (`id`)
459) ENGINE=ndbcluster DEFAULT CHARSET=latin1
460/*!50100 PARTITION BY LIST (id)
461(PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
462 PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
463 PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
464--- Make sure that our tables on slave are still same engine ---
465--- and that the alter statements replicated correctly ---
466SHOW CREATE TABLE t1;
467Table	Create Table
468t1	CREATE TABLE `t1` (
469  `id` mediumint(9) NOT NULL,
470  `b1` bit(8) DEFAULT NULL,
471  `vc` text,
472  `bc` char(255) DEFAULT NULL,
473  `d` decimal(10,4) DEFAULT '0.0000',
474  `f` float DEFAULT '0',
475  `total` bigint(20) unsigned DEFAULT NULL,
476  `y` year(4) DEFAULT NULL,
477  `t` date DEFAULT NULL,
478  PRIMARY KEY (`id`)
479) ENGINE=MyISAM DEFAULT CHARSET=latin1
480/*!50100 PARTITION BY LIST (id)
481(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
482 PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
483 PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
484--- Perform basic operation on master ---
485--- and ensure replicated correctly ---
486"--- Insert into t1 --" as "";
487--- Select from t1 on master ---
488select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
489id	hex(b1)	vc	bc	d	f	total	y	t
4902	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
4914	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
49242	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
493142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
494412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
495--- Select from t1 on slave ---
496select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
497id	hex(b1)	vc	bc	d	f	total	y	t
4982	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
4994	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
50042	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
501142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
502412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
503--- Update t1 on master --
504UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
505--- Check the update on master ---
506SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
507id	hex(b1)	vc	bc	d	f	total	y	t
508412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
509--- Check Update on slave ---
510SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
511id	hex(b1)	vc	bc	d	f	total	y	t
512412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
513--- Remove a record from t1 on master ---
514DELETE FROM t1 WHERE id = 42;
515--- Show current count on master for t1 ---
516SELECT COUNT(*) FROM t1;
517COUNT(*)
5184
519--- Show current count on slave for t1 ---
520SELECT COUNT(*) FROM t1;
521COUNT(*)
5224
523DELETE FROM t1;
524--- End test 3 partition LIST testing ---
525--- Do Cleanup --
526DROP TABLE IF EXISTS t1;
527--- Start test 4 partition HASH testing ---
528--- Do setup ---
529CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
530bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
531f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
532y YEAR, t DATE, primary key(t))
533PARTITION BY HASH( YEAR(t) )
534PARTITIONS 4;
535--- show that tables have been created correctly ---
536SHOW CREATE TABLE t1;
537Table	Create Table
538t1	CREATE TABLE `t1` (
539  `id` mediumint(9) NOT NULL,
540  `b1` bit(8) DEFAULT NULL,
541  `vc` varchar(255) DEFAULT NULL,
542  `bc` char(255) DEFAULT NULL,
543  `d` decimal(10,4) DEFAULT '0.0000',
544  `f` float DEFAULT '0',
545  `total` bigint(20) unsigned DEFAULT NULL,
546  `y` year(4) DEFAULT NULL,
547  `t` date NOT NULL DEFAULT '0000-00-00',
548  PRIMARY KEY (`t`)
549) ENGINE=ndbcluster DEFAULT CHARSET=latin1
550/*!50100 PARTITION BY HASH ( YEAR(t))
551PARTITIONS 4 */
552SHOW CREATE TABLE t1;
553Table	Create Table
554t1	CREATE TABLE `t1` (
555  `id` mediumint(9) NOT NULL,
556  `b1` bit(8) DEFAULT NULL,
557  `vc` varchar(255) DEFAULT NULL,
558  `bc` char(255) DEFAULT NULL,
559  `d` decimal(10,4) DEFAULT '0.0000',
560  `f` float DEFAULT '0',
561  `total` bigint(20) unsigned DEFAULT NULL,
562  `y` year(4) DEFAULT NULL,
563  `t` date NOT NULL DEFAULT '0000-00-00',
564  PRIMARY KEY (`t`)
565) ENGINE=MyISAM DEFAULT CHARSET=latin1
566/*!50100 PARTITION BY HASH ( YEAR(t))
567PARTITIONS 4 */
568--- Perform basic operation on master ---
569--- and ensure replicated correctly ---
570"--- Insert into t1 --" as "";
571--- Select from t1 on master ---
572select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
573id	hex(b1)	vc	bc	d	f	total	y	t
5742	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
5754	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
57642	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
577142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
578412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
579--- Select from t1 on slave ---
580select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
581id	hex(b1)	vc	bc	d	f	total	y	t
5822	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
5834	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
58442	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
585142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
586412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
587--- Update t1 on master --
588UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
589--- Check the update on master ---
590SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
591id	hex(b1)	vc	bc	d	f	total	y	t
592412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
593--- Check Update on slave ---
594SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
595id	hex(b1)	vc	bc	d	f	total	y	t
596412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
597--- Remove a record from t1 on master ---
598DELETE FROM t1 WHERE id = 42;
599--- Show current count on master for t1 ---
600SELECT COUNT(*) FROM t1;
601COUNT(*)
6024
603--- Show current count on slave for t1 ---
604SELECT COUNT(*) FROM t1;
605COUNT(*)
6064
607DELETE FROM t1;
608--- Check that simple Alter statements are replicated correctly ---
609ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(t,id);
610ALTER TABLE t1 MODIFY vc TEXT;
611--- Show the new improved table on the master ---
612SHOW CREATE TABLE t1;
613Table	Create Table
614t1	CREATE TABLE `t1` (
615  `id` mediumint(9) NOT NULL,
616  `b1` bit(8) DEFAULT NULL,
617  `vc` text,
618  `bc` char(255) DEFAULT NULL,
619  `d` decimal(10,4) DEFAULT '0.0000',
620  `f` float DEFAULT '0',
621  `total` bigint(20) unsigned DEFAULT NULL,
622  `y` year(4) DEFAULT NULL,
623  `t` date NOT NULL DEFAULT '0000-00-00',
624  PRIMARY KEY (`t`,`id`)
625) ENGINE=ndbcluster DEFAULT CHARSET=latin1
626/*!50100 PARTITION BY HASH ( YEAR(t))
627PARTITIONS 4 */
628--- Make sure that our tables on slave are still same engine ---
629--- and that the alter statements replicated correctly ---
630SHOW CREATE TABLE t1;
631Table	Create Table
632t1	CREATE TABLE `t1` (
633  `id` mediumint(9) NOT NULL,
634  `b1` bit(8) DEFAULT NULL,
635  `vc` text,
636  `bc` char(255) DEFAULT NULL,
637  `d` decimal(10,4) DEFAULT '0.0000',
638  `f` float DEFAULT '0',
639  `total` bigint(20) unsigned DEFAULT NULL,
640  `y` year(4) DEFAULT NULL,
641  `t` date NOT NULL DEFAULT '0000-00-00',
642  PRIMARY KEY (`t`,`id`)
643) ENGINE=MyISAM DEFAULT CHARSET=latin1
644/*!50100 PARTITION BY HASH ( YEAR(t))
645PARTITIONS 4 */
646--- Perform basic operation on master ---
647--- and ensure replicated correctly ---
648"--- Insert into t1 --" as "";
649--- Select from t1 on master ---
650select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
651id	hex(b1)	vc	bc	d	f	total	y	t
6522	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
6534	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
65442	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
655142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
656412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
657--- Select from t1 on slave ---
658select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
659id	hex(b1)	vc	bc	d	f	total	y	t
6602	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
6614	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
66242	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
663142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
664412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
665--- Update t1 on master --
666UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
667--- Check the update on master ---
668SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
669id	hex(b1)	vc	bc	d	f	total	y	t
670412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
671--- Check Update on slave ---
672SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
673id	hex(b1)	vc	bc	d	f	total	y	t
674412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
675--- Remove a record from t1 on master ---
676DELETE FROM t1 WHERE id = 42;
677--- Show current count on master for t1 ---
678SELECT COUNT(*) FROM t1;
679COUNT(*)
6804
681--- Show current count on slave for t1 ---
682SELECT COUNT(*) FROM t1;
683COUNT(*)
6844
685DELETE FROM t1;
686--- End test 4 partition HASH testing ---
687--- Do Cleanup --
688DROP TABLE IF EXISTS t1;
689--- Start test 5 partition by key testing ---
690--- Create Table Section ---
691CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
692bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
693f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
694y YEAR, t DATE,PRIMARY KEY(id))
695PARTITION BY KEY()
696PARTITIONS 4;
697--- Show that tables on master are ndbcluster tables ---
698SHOW CREATE TABLE t1;
699Table	Create Table
700t1	CREATE TABLE `t1` (
701  `id` mediumint(9) NOT NULL,
702  `b1` bit(8) DEFAULT NULL,
703  `vc` varchar(255) DEFAULT NULL,
704  `bc` char(255) DEFAULT NULL,
705  `d` decimal(10,4) DEFAULT '0.0000',
706  `f` float DEFAULT '0',
707  `total` bigint(20) unsigned DEFAULT NULL,
708  `y` year(4) DEFAULT NULL,
709  `t` date DEFAULT NULL,
710  PRIMARY KEY (`id`)
711) ENGINE=ndbcluster DEFAULT CHARSET=latin1
712/*!50100 PARTITION BY KEY ()
713PARTITIONS 4 */
714--- Show that tables on slave ---
715SHOW CREATE TABLE t1;
716Table	Create Table
717t1	CREATE TABLE `t1` (
718  `id` mediumint(9) NOT NULL,
719  `b1` bit(8) DEFAULT NULL,
720  `vc` varchar(255) DEFAULT NULL,
721  `bc` char(255) DEFAULT NULL,
722  `d` decimal(10,4) DEFAULT '0.0000',
723  `f` float DEFAULT '0',
724  `total` bigint(20) unsigned DEFAULT NULL,
725  `y` year(4) DEFAULT NULL,
726  `t` date DEFAULT NULL,
727  PRIMARY KEY (`id`)
728) ENGINE=MyISAM DEFAULT CHARSET=latin1
729/*!50100 PARTITION BY KEY ()
730PARTITIONS 4 */
731--- Perform basic operation on master ---
732--- and ensure replicated correctly ---
733"--- Insert into t1 --" as "";
734--- Select from t1 on master ---
735select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
736id	hex(b1)	vc	bc	d	f	total	y	t
7372	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
7384	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
73942	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
740142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
741412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
742--- Select from t1 on slave ---
743select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
744id	hex(b1)	vc	bc	d	f	total	y	t
7452	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
7464	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
74742	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
748142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
749412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
750--- Update t1 on master --
751UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
752--- Check the update on master ---
753SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
754id	hex(b1)	vc	bc	d	f	total	y	t
755412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
756--- Check Update on slave ---
757SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
758id	hex(b1)	vc	bc	d	f	total	y	t
759412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
760--- Remove a record from t1 on master ---
761DELETE FROM t1 WHERE id = 42;
762--- Show current count on master for t1 ---
763SELECT COUNT(*) FROM t1;
764COUNT(*)
7654
766--- Show current count on slave for t1 ---
767SELECT COUNT(*) FROM t1;
768COUNT(*)
7694
770DELETE FROM t1;
771--- Check that simple Alter statements are replicated correctly ---
772ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
773--- Show the new improved table on the master ---
774SHOW CREATE TABLE t1;
775Table	Create Table
776t1	CREATE TABLE `t1` (
777  `id` mediumint(9) NOT NULL,
778  `b1` bit(8) DEFAULT NULL,
779  `vc` varchar(255) DEFAULT NULL,
780  `bc` char(255) DEFAULT NULL,
781  `d` decimal(10,4) DEFAULT '0.0000',
782  `f` float DEFAULT '0',
783  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
784  `y` year(4) DEFAULT NULL,
785  `t` date DEFAULT NULL,
786  PRIMARY KEY (`id`,`total`)
787) ENGINE=ndbcluster DEFAULT CHARSET=latin1
788/*!50100 PARTITION BY KEY ()
789PARTITIONS 4 */
790--- Make sure that our tables on slave are still right type ---
791--- and that the alter statements replicated correctly ---
792SHOW CREATE TABLE t1;
793Table	Create Table
794t1	CREATE TABLE `t1` (
795  `id` mediumint(9) NOT NULL,
796  `b1` bit(8) DEFAULT NULL,
797  `vc` varchar(255) DEFAULT NULL,
798  `bc` char(255) DEFAULT NULL,
799  `d` decimal(10,4) DEFAULT '0.0000',
800  `f` float DEFAULT '0',
801  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
802  `y` year(4) DEFAULT NULL,
803  `t` date DEFAULT NULL,
804  PRIMARY KEY (`id`,`total`)
805) ENGINE=MyISAM DEFAULT CHARSET=latin1
806/*!50100 PARTITION BY KEY ()
807PARTITIONS 4 */
808--- Perform basic operation on master ---
809--- and ensure replicated correctly ---
810"--- Insert into t1 --" as "";
811--- Select from t1 on master ---
812select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
813id	hex(b1)	vc	bc	d	f	total	y	t
8142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
8154	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
81642	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
817142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
818412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
819--- Select from t1 on slave ---
820select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
821id	hex(b1)	vc	bc	d	f	total	y	t
8222	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
8234	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
82442	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
825142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
826412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
827--- Update t1 on master --
828UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
829--- Check the update on master ---
830SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
831id	hex(b1)	vc	bc	d	f	total	y	t
832412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
833--- Check Update on slave ---
834SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
835id	hex(b1)	vc	bc	d	f	total	y	t
836412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
837--- Remove a record from t1 on master ---
838DELETE FROM t1 WHERE id = 42;
839--- Show current count on master for t1 ---
840SELECT COUNT(*) FROM t1;
841COUNT(*)
8424
843--- Show current count on slave for t1 ---
844SELECT COUNT(*) FROM t1;
845COUNT(*)
8464
847DELETE FROM t1;
848--- Check that simple Alter statements are replicated correctly ---
849ALTER TABLE t1 MODIFY vc TEXT;
850--- Show the new improved table on the master ---
851SHOW CREATE TABLE t1;
852Table	Create Table
853t1	CREATE TABLE `t1` (
854  `id` mediumint(9) NOT NULL,
855  `b1` bit(8) DEFAULT NULL,
856  `vc` text,
857  `bc` char(255) DEFAULT NULL,
858  `d` decimal(10,4) DEFAULT '0.0000',
859  `f` float DEFAULT '0',
860  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
861  `y` year(4) DEFAULT NULL,
862  `t` date DEFAULT NULL,
863  PRIMARY KEY (`id`,`total`)
864) ENGINE=ndbcluster DEFAULT CHARSET=latin1
865/*!50100 PARTITION BY KEY ()
866PARTITIONS 4 */
867--- Make sure that our tables on slave are still same engine ---
868--- and that the alter statements replicated correctly ---
869SHOW CREATE TABLE t1;
870Table	Create Table
871t1	CREATE TABLE `t1` (
872  `id` mediumint(9) NOT NULL,
873  `b1` bit(8) DEFAULT NULL,
874  `vc` text,
875  `bc` char(255) DEFAULT NULL,
876  `d` decimal(10,4) DEFAULT '0.0000',
877  `f` float DEFAULT '0',
878  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
879  `y` year(4) DEFAULT NULL,
880  `t` date DEFAULT NULL,
881  PRIMARY KEY (`id`,`total`)
882) ENGINE=MyISAM DEFAULT CHARSET=latin1
883/*!50100 PARTITION BY KEY ()
884PARTITIONS 4 */
885--- Perform basic operation on master ---
886--- and ensure replicated correctly ---
887"--- Insert into t1 --" as "";
888--- Select from t1 on master ---
889select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
890id	hex(b1)	vc	bc	d	f	total	y	t
8912	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
8924	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
89342	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
894142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
895412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
896--- Select from t1 on slave ---
897select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
898id	hex(b1)	vc	bc	d	f	total	y	t
8992	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1965-11-14
9004	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1985-11-14
90142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1905-11-14
902142	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	1995-11-14
903412	1	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2005-11-14
904--- Update t1 on master --
905UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
906--- Check the update on master ---
907SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
908id	hex(b1)	vc	bc	d	f	total	y	t
909412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
910--- Check Update on slave ---
911SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
912id	hex(b1)	vc	bc	d	f	total	y	t
913412	0	Testing MySQL databases is a cool 	Must make it bug free for the customer	654321.4321	15.21	0	1965	2006-02-22
914--- Remove a record from t1 on master ---
915DELETE FROM t1 WHERE id = 42;
916--- Show current count on master for t1 ---
917SELECT COUNT(*) FROM t1;
918COUNT(*)
9194
920--- Show current count on slave for t1 ---
921SELECT COUNT(*) FROM t1;
922COUNT(*)
9234
924DELETE FROM t1;
925--- End test 5 key partition testing ---
926--- Do Cleanup ---
927DROP TABLE IF EXISTS t1;
928set @@global.slave_exec_mode= 'STRICT';
929drop table mysql.ndb_apply_status;
930include/rpl_end.inc
931