mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / rpl_ndb / r / rpl_ndb_2other.result
blobeae70ca5a698d2cb277b1f0ca6fe8312a69318ac
1 include/master-slave.inc
2 [connection master]
3 SET storage_engine=ndb;
5 === NDB -> MYISAM ===
7 set @old_slave_exec_mode= @@global.slave_exec_mode;
8 set @@global.slave_exec_mode= 'IDEMPOTENT';
9 CREATE TABLE mysql.ndb_apply_status
10 ( server_id INT UNSIGNED NOT NULL,
11 epoch BIGINT UNSIGNED NOT NULL,
12 log_name VARCHAR(255) BINARY NOT NULL,
13 start_pos BIGINT UNSIGNED NOT NULL,
14 end_pos BIGINT UNSIGNED NOT NULL,
15 PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
16 SET storage_engine=myisam;
17 --- Doing pre test cleanup --- 
18 DROP TABLE IF EXISTS t1;
19 --- Create Table Section ---
20 CREATE TABLE t1 (id MEDIUMINT NOT NULL, 
21 b1 INT, 
22 vc VARCHAR(255), 
23 bc CHAR(255), 
24 d DECIMAL(10,4) DEFAULT 0, 
25 f FLOAT DEFAULT 0, 
26 total BIGINT UNSIGNED, 
27 y YEAR, 
28 t DATE, 
29 PRIMARY KEY(id));
30 --- Show table on master ---
31 SHOW CREATE TABLE t1;
32 Table   Create Table
33 t1      CREATE TABLE `t1` (
34   `id` mediumint(9) NOT NULL,
35   `b1` int(11) DEFAULT NULL,
36   `vc` varchar(255) DEFAULT NULL,
37   `bc` char(255) DEFAULT NULL,
38   `d` decimal(10,4) DEFAULT '0.0000',
39   `f` float DEFAULT '0',
40   `total` bigint(20) unsigned DEFAULT NULL,
41   `y` year(4) DEFAULT NULL,
42   `t` date DEFAULT NULL,
43   PRIMARY KEY (`id`)
44 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
45 --- Show table on slave ---
46 SHOW CREATE TABLE t1;
47 Table   Create Table
48 t1      CREATE TABLE `t1` (
49   `id` mediumint(9) NOT NULL,
50   `b1` int(11) DEFAULT NULL,
51   `vc` varchar(255) DEFAULT NULL,
52   `bc` char(255) DEFAULT NULL,
53   `d` decimal(10,4) DEFAULT '0.0000',
54   `f` float DEFAULT '0',
55   `total` bigint(20) unsigned DEFAULT NULL,
56   `y` year(4) DEFAULT NULL,
57   `t` date DEFAULT NULL,
58   PRIMARY KEY (`id`)
59 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
60 STOP SLAVE;
61 RESET SLAVE;
62 RESET MASTER;
63 START SLAVE;
64 --- Populate t1 with data ---
65 --- Select from t1 on master --- 
66 select *
67 from t1 
68 order by id;
69 id      b1      vc      bc      d       f       total   y       t
70 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
71 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
72 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
73 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
74 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
75 --- Select from t1 on slave ---
76 select *
77 from t1 
78 order by id;
79 id      b1      vc      bc      d       f       total   y       t
80 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
81 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
82 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
83 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
84 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
85 --- Perform basic operation on master ---
86 --- and ensure replicated correctly ---
87 --- Update t1 on master --
88 UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" 
89 WHERE id < 100 
90 ORDER BY id;
91 --- Check the update on master --- 
92 SELECT *
93 FROM t1 
94 WHERE id < 100
95 ORDER BY id;
96 id      b1      vc      bc      d       f       total   y       t
97 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
98 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
99 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
100 --- Check Update on slave ---
101 SELECT *
102 FROM t1 
103 WHERE id < 100
104 ORDER BY id;
105 id      b1      vc      bc      d       f       total   y       t
106 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
107 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
108 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
109 --- Remove a record from t1 on master ---
110 DELETE FROM t1 WHERE id = 412;
111 --- Show current count on master for t1 ---
112 SELECT COUNT(*) FROM t1;
113 COUNT(*)
115 --- Show current count on slave for t1 --- 
116 SELECT COUNT(*) FROM t1;
117 COUNT(*)
119 TRUNCATE TABLE t1;
120 --- Check that simple Alter statements are replicated correctly --
121 ALTER TABLE t1 DROP PRIMARY KEY;
122 ALTER TABLE t1 MODIFY vc char(32);
123 --- Show the new improved table on the master ---
124 SHOW CREATE TABLE t1;
125 Table   Create Table
126 t1      CREATE TABLE `t1` (
127   `id` mediumint(9) NOT NULL,
128   `b1` int(11) DEFAULT NULL,
129   `vc` char(32) DEFAULT NULL,
130   `bc` char(255) DEFAULT NULL,
131   `d` decimal(10,4) DEFAULT '0.0000',
132   `f` float DEFAULT '0',
133   `total` bigint(20) unsigned DEFAULT NULL,
134   `y` year(4) DEFAULT NULL,
135   `t` date DEFAULT NULL
136 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
137 --- Make sure that our tables on slave are still same engine ---
138 --- and that the alter statements replicated correctly ---
139 SHOW CREATE TABLE t1;
140 Table   Create Table
141 t1      CREATE TABLE `t1` (
142   `id` mediumint(9) NOT NULL,
143   `b1` int(11) DEFAULT NULL,
144   `vc` char(32) DEFAULT NULL,
145   `bc` char(255) DEFAULT NULL,
146   `d` decimal(10,4) DEFAULT '0.0000',
147   `f` float DEFAULT '0',
148   `total` bigint(20) unsigned DEFAULT NULL,
149   `y` year(4) DEFAULT NULL,
150   `t` date DEFAULT NULL
151 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
152 STOP SLAVE;
153 RESET SLAVE;
154 RESET MASTER;
155 START SLAVE;
156 --- Populate t1 with data ---
157 --- Select from t1 on master --- 
158 select *
159 from t1 
160 order by id;
161 id      b1      vc      bc      d       f       total   y       t
162 2       1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
163 4       1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
164 42      1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
165 142     1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
166 412     1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
167 --- Select from t1 on slave ---
168 select *
169 from t1 
170 order by id;
171 id      b1      vc      bc      d       f       total   y       t
172 2       1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
173 4       1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
174 42      1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
175 142     1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
176 412     1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
177 --- Perform basic operation on master ---
178 --- and ensure replicated correctly ---
179 --- Update t1 on master --
180 UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" 
181 WHERE id < 100 
182 ORDER BY id;
183 --- Check the update on master --- 
184 SELECT *
185 FROM t1 
186 WHERE id < 100
187 ORDER BY id;
188 id      b1      vc      bc      d       f       total   y       t
189 2       0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
190 4       0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
191 42      0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
192 --- Check Update on slave ---
193 SELECT *
194 FROM t1 
195 WHERE id < 100
196 ORDER BY id;
197 id      b1      vc      bc      d       f       total   y       t
198 2       0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
199 4       0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
200 42      0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
201 --- Remove a record from t1 on master ---
202 DELETE FROM t1 WHERE id = 412;
203 --- Show current count on master for t1 ---
204 SELECT COUNT(*) FROM t1;
205 COUNT(*)
207 --- Show current count on slave for t1 --- 
208 SELECT COUNT(*) FROM t1;
209 COUNT(*)
211 TRUNCATE TABLE t1;
212 --- Check that replication works when slave has more columns than master
213 ALTER TABLE t1 ADD PRIMARY KEY(id,total);
214 ALTER TABLE t1 MODIFY vc TEXT;
215 INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ',
216 'Must make it bug free for the customer',
217 654321.4321,15.21,0,1965,"1905-11-14");
218 INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ',
219 'Must make it bug free for the customer',
220 654321.4321,15.21,0,1965,"1965-11-14");
221 INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ',
222 'Must make it bug free for the customer',
223 654321.4321,15.21,0,1965,"1985-11-14");
224 --- Add columns on slave ---
225 ALTER TABLE t1 ADD (u int, v char(16) default 'default');
226 UPDATE t1 SET u=7 WHERE id < 50;
227 UPDATE t1 SET v='explicit' WHERE id >10;
228 --- Show changed table on slave ---
229 SHOW CREATE TABLE t1;
230 Table   Create Table
231 t1      CREATE TABLE `t1` (
232   `id` mediumint(9) NOT NULL,
233   `b1` int(11) DEFAULT NULL,
234   `vc` text,
235   `bc` char(255) DEFAULT NULL,
236   `d` decimal(10,4) DEFAULT '0.0000',
237   `f` float DEFAULT '0',
238   `total` bigint(20) unsigned NOT NULL DEFAULT '0',
239   `y` year(4) DEFAULT NULL,
240   `t` date DEFAULT NULL,
241   `u` int(11) DEFAULT NULL,
242   `v` char(16) DEFAULT 'default',
243   PRIMARY KEY (`id`,`total`)
244 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
245 SELECT * 
246 FROM t1
247 ORDER BY id;
248 id      b1      vc      bc      d       f       total   y       t       u       v
249 3       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14      7       default
250 20      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14      7       explicit
251 50      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14      NULL    explicit
252 STOP SLAVE;
253 RESET SLAVE;
254 RESET MASTER;
255 START SLAVE;
256 --- Populate t1 with data ---
257 --- Select from t1 on master --- 
258 select *
259 from t1 
260 order by id;
261 id      b1      vc      bc      d       f       total   y       t
262 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
263 3       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
264 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
265 20      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
266 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
267 50      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
268 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
269 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
270 --- Select from t1 on slave ---
271 select *
272 from t1 
273 order by id;
274 id      b1      vc      bc      d       f       total   y       t       u       v
275 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14      NULL    default
276 3       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14      7       default
277 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14      NULL    default
278 20      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14      7       explicit
279 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14      NULL    default
280 50      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14      NULL    explicit
281 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14      NULL    default
282 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14      NULL    default
283 --- Perform basic operation on master ---
284 --- and ensure replicated correctly ---
285 --- Update t1 on master --
286 UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" 
287 WHERE id < 100 
288 ORDER BY id;
289 --- Check the update on master --- 
290 SELECT *
291 FROM t1 
292 WHERE id < 100
293 ORDER BY id;
294 id      b1      vc      bc      d       f       total   y       t
295 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
296 3       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
297 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
298 20      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
299 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
300 50      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
301 --- Check Update on slave ---
302 SELECT *
303 FROM t1 
304 WHERE id < 100
305 ORDER BY id;
306 id      b1      vc      bc      d       f       total   y       t       u       v
307 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      NULL    default
308 3       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      7       default
309 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      NULL    default
310 20      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      7       explicit
311 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      NULL    default
312 50      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      NULL    explicit
313 --- Remove a record from t1 on master ---
314 DELETE FROM t1 WHERE id = 412;
315 --- Show current count on master for t1 ---
316 SELECT COUNT(*) FROM t1;
317 COUNT(*)
319 --- Show current count on slave for t1 --- 
320 SELECT COUNT(*) FROM t1;
321 COUNT(*)
323 TRUNCATE TABLE t1;
324 TRUNCATE TABLE t1;
325 --- Check that replication works when master has more columns than slave
326 --- Remove columns on slave ---
327 ALTER TABLE t1 DROP COLUMN v;
328 ALTER TABLE t1 DROP COLUMN u;
329 ALTER TABLE t1 DROP COLUMN t;
330 ALTER TABLE t1 DROP COLUMN y;
331 --- Show changed table on slave ---
332 SHOW CREATE TABLE t1;
333 Table   Create Table
334 t1      CREATE TABLE `t1` (
335   `id` mediumint(9) NOT NULL,
336   `b1` int(11) DEFAULT NULL,
337   `vc` text,
338   `bc` char(255) DEFAULT NULL,
339   `d` decimal(10,4) DEFAULT '0.0000',
340   `f` float DEFAULT '0',
341   `total` bigint(20) unsigned NOT NULL DEFAULT '0',
342   PRIMARY KEY (`id`,`total`)
343 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
344 STOP SLAVE;
345 RESET SLAVE;
346 RESET MASTER;
347 START SLAVE;
348 --- Populate t1 with data ---
349 --- Select from t1 on master --- 
350 select *
351 from t1 
352 order by id;
353 id      b1      vc      bc      d       f       total   y       t
354 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
355 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
356 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
357 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
358 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
359 --- Select from t1 on slave ---
360 select *
361 from t1 
362 order by id;
363 id      b1      vc      bc      d       f       total
364 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
365 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
366 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
367 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
368 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
369 --- Perform basic operation on master ---
370 --- and ensure replicated correctly ---
371 --- Update t1 on master --
372 UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" 
373 WHERE id < 100 
374 ORDER BY id;
375 --- Check the update on master --- 
376 SELECT *
377 FROM t1 
378 WHERE id < 100
379 ORDER BY id;
380 id      b1      vc      bc      d       f       total   y       t
381 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
382 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
383 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
384 --- Check Update on slave ---
385 SELECT *
386 FROM t1 
387 WHERE id < 100
388 ORDER BY id;
389 id      b1      vc      bc      d       f       total
390 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0
391 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0
392 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0
393 --- Remove a record from t1 on master ---
394 DELETE FROM t1 WHERE id = 412;
395 --- Show current count on master for t1 ---
396 SELECT COUNT(*) FROM t1;
397 COUNT(*)
399 --- Show current count on slave for t1 --- 
400 SELECT COUNT(*) FROM t1;
401 COUNT(*)
403 TRUNCATE TABLE t1;
404 TRUNCATE TABLE t1;
405 --- Do Cleanup --
406 DROP TABLE IF EXISTS t1;
408 === NDB -> INNODB ===
410 alter table mysql.ndb_apply_status engine=innodb;
411 SET storage_engine=innodb;
412 --- Doing pre test cleanup --- 
413 DROP TABLE IF EXISTS t1;
414 --- Create Table Section ---
415 CREATE TABLE t1 (id MEDIUMINT NOT NULL, 
416 b1 INT, 
417 vc VARCHAR(255), 
418 bc CHAR(255), 
419 d DECIMAL(10,4) DEFAULT 0, 
420 f FLOAT DEFAULT 0, 
421 total BIGINT UNSIGNED, 
422 y YEAR, 
423 t DATE, 
424 PRIMARY KEY(id));
425 --- Show table on master ---
426 SHOW CREATE TABLE t1;
427 Table   Create Table
428 t1      CREATE TABLE `t1` (
429   `id` mediumint(9) NOT NULL,
430   `b1` int(11) DEFAULT NULL,
431   `vc` varchar(255) DEFAULT NULL,
432   `bc` char(255) DEFAULT NULL,
433   `d` decimal(10,4) DEFAULT '0.0000',
434   `f` float DEFAULT '0',
435   `total` bigint(20) unsigned DEFAULT NULL,
436   `y` year(4) DEFAULT NULL,
437   `t` date DEFAULT NULL,
438   PRIMARY KEY (`id`)
439 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
440 --- Show table on slave ---
441 SHOW CREATE TABLE t1;
442 Table   Create Table
443 t1      CREATE TABLE `t1` (
444   `id` mediumint(9) NOT NULL,
445   `b1` int(11) DEFAULT NULL,
446   `vc` varchar(255) DEFAULT NULL,
447   `bc` char(255) DEFAULT NULL,
448   `d` decimal(10,4) DEFAULT '0.0000',
449   `f` float DEFAULT '0',
450   `total` bigint(20) unsigned DEFAULT NULL,
451   `y` year(4) DEFAULT NULL,
452   `t` date DEFAULT NULL,
453   PRIMARY KEY (`id`)
454 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
455 STOP SLAVE;
456 RESET SLAVE;
457 RESET MASTER;
458 START SLAVE;
459 --- Populate t1 with data ---
460 --- Select from t1 on master --- 
461 select *
462 from t1 
463 order by id;
464 id      b1      vc      bc      d       f       total   y       t
465 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
466 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
467 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
468 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
469 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
470 --- Select from t1 on slave ---
471 select *
472 from t1 
473 order by id;
474 id      b1      vc      bc      d       f       total   y       t
475 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
476 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
477 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
478 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
479 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
480 --- Perform basic operation on master ---
481 --- and ensure replicated correctly ---
482 --- Update t1 on master --
483 UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" 
484 WHERE id < 100 
485 ORDER BY id;
486 --- Check the update on master --- 
487 SELECT *
488 FROM t1 
489 WHERE id < 100
490 ORDER BY id;
491 id      b1      vc      bc      d       f       total   y       t
492 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
493 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
494 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
495 --- Check Update on slave ---
496 SELECT *
497 FROM t1 
498 WHERE id < 100
499 ORDER BY id;
500 id      b1      vc      bc      d       f       total   y       t
501 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
502 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
503 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
504 --- Remove a record from t1 on master ---
505 DELETE FROM t1 WHERE id = 412;
506 --- Show current count on master for t1 ---
507 SELECT COUNT(*) FROM t1;
508 COUNT(*)
510 --- Show current count on slave for t1 --- 
511 SELECT COUNT(*) FROM t1;
512 COUNT(*)
514 TRUNCATE TABLE t1;
515 --- Check that simple Alter statements are replicated correctly --
516 ALTER TABLE t1 DROP PRIMARY KEY;
517 ALTER TABLE t1 MODIFY vc char(32);
518 --- Show the new improved table on the master ---
519 SHOW CREATE TABLE t1;
520 Table   Create Table
521 t1      CREATE TABLE `t1` (
522   `id` mediumint(9) NOT NULL,
523   `b1` int(11) DEFAULT NULL,
524   `vc` char(32) DEFAULT NULL,
525   `bc` char(255) DEFAULT NULL,
526   `d` decimal(10,4) DEFAULT '0.0000',
527   `f` float DEFAULT '0',
528   `total` bigint(20) unsigned DEFAULT NULL,
529   `y` year(4) DEFAULT NULL,
530   `t` date DEFAULT NULL
531 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
532 --- Make sure that our tables on slave are still same engine ---
533 --- and that the alter statements replicated correctly ---
534 SHOW CREATE TABLE t1;
535 Table   Create Table
536 t1      CREATE TABLE `t1` (
537   `id` mediumint(9) NOT NULL,
538   `b1` int(11) DEFAULT NULL,
539   `vc` char(32) DEFAULT NULL,
540   `bc` char(255) DEFAULT NULL,
541   `d` decimal(10,4) DEFAULT '0.0000',
542   `f` float DEFAULT '0',
543   `total` bigint(20) unsigned DEFAULT NULL,
544   `y` year(4) DEFAULT NULL,
545   `t` date DEFAULT NULL
546 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
547 STOP SLAVE;
548 RESET SLAVE;
549 RESET MASTER;
550 START SLAVE;
551 --- Populate t1 with data ---
552 --- Select from t1 on master --- 
553 select *
554 from t1 
555 order by id;
556 id      b1      vc      bc      d       f       total   y       t
557 2       1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
558 4       1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
559 42      1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
560 142     1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
561 412     1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
562 --- Select from t1 on slave ---
563 select *
564 from t1 
565 order by id;
566 id      b1      vc      bc      d       f       total   y       t
567 2       1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
568 4       1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
569 42      1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
570 142     1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
571 412     1       Testing MySQL databases is a coo        Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
572 --- Perform basic operation on master ---
573 --- and ensure replicated correctly ---
574 --- Update t1 on master --
575 UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" 
576 WHERE id < 100 
577 ORDER BY id;
578 --- Check the update on master --- 
579 SELECT *
580 FROM t1 
581 WHERE id < 100
582 ORDER BY id;
583 id      b1      vc      bc      d       f       total   y       t
584 2       0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
585 4       0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
586 42      0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
587 --- Check Update on slave ---
588 SELECT *
589 FROM t1 
590 WHERE id < 100
591 ORDER BY id;
592 id      b1      vc      bc      d       f       total   y       t
593 2       0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
594 4       0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
595 42      0       Testing MySQL databases is a coo        updated 654321.4321     15.21   0       1965    2006-02-22
596 --- Remove a record from t1 on master ---
597 DELETE FROM t1 WHERE id = 412;
598 --- Show current count on master for t1 ---
599 SELECT COUNT(*) FROM t1;
600 COUNT(*)
602 --- Show current count on slave for t1 --- 
603 SELECT COUNT(*) FROM t1;
604 COUNT(*)
606 TRUNCATE TABLE t1;
607 --- Check that replication works when slave has more columns than master
608 ALTER TABLE t1 ADD PRIMARY KEY(id,total);
609 ALTER TABLE t1 MODIFY vc TEXT;
610 INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ',
611 'Must make it bug free for the customer',
612 654321.4321,15.21,0,1965,"1905-11-14");
613 INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ',
614 'Must make it bug free for the customer',
615 654321.4321,15.21,0,1965,"1965-11-14");
616 INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ',
617 'Must make it bug free for the customer',
618 654321.4321,15.21,0,1965,"1985-11-14");
619 --- Add columns on slave ---
620 ALTER TABLE t1 ADD (u int, v char(16) default 'default');
621 UPDATE t1 SET u=7 WHERE id < 50;
622 UPDATE t1 SET v='explicit' WHERE id >10;
623 --- Show changed table on slave ---
624 SHOW CREATE TABLE t1;
625 Table   Create Table
626 t1      CREATE TABLE `t1` (
627   `id` mediumint(9) NOT NULL,
628   `b1` int(11) DEFAULT NULL,
629   `vc` text,
630   `bc` char(255) DEFAULT NULL,
631   `d` decimal(10,4) DEFAULT '0.0000',
632   `f` float DEFAULT '0',
633   `total` bigint(20) unsigned NOT NULL DEFAULT '0',
634   `y` year(4) DEFAULT NULL,
635   `t` date DEFAULT NULL,
636   `u` int(11) DEFAULT NULL,
637   `v` char(16) DEFAULT 'default',
638   PRIMARY KEY (`id`,`total`)
639 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
640 SELECT * 
641 FROM t1
642 ORDER BY id;
643 id      b1      vc      bc      d       f       total   y       t       u       v
644 3       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14      7       default
645 20      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14      7       explicit
646 50      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14      NULL    explicit
647 STOP SLAVE;
648 RESET SLAVE;
649 RESET MASTER;
650 START SLAVE;
651 --- Populate t1 with data ---
652 --- Select from t1 on master --- 
653 select *
654 from t1 
655 order by id;
656 id      b1      vc      bc      d       f       total   y       t
657 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
658 3       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
659 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
660 20      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
661 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
662 50      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
663 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
664 412     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 --- Select from t1 on slave ---
666 select *
667 from t1 
668 order by id;
669 id      b1      vc      bc      d       f       total   y       t       u       v
670 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14      NULL    default
671 3       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14      7       default
672 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14      NULL    default
673 20      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14      7       explicit
674 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14      NULL    default
675 50      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14      NULL    explicit
676 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14      NULL    default
677 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14      NULL    default
678 --- Perform basic operation on master ---
679 --- and ensure replicated correctly ---
680 --- Update t1 on master --
681 UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" 
682 WHERE id < 100 
683 ORDER BY id;
684 --- Check the update on master --- 
685 SELECT *
686 FROM t1 
687 WHERE id < 100
688 ORDER BY id;
689 id      b1      vc      bc      d       f       total   y       t
690 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
691 3       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
692 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
693 20      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
694 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
695 50      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
696 --- Check Update on slave ---
697 SELECT *
698 FROM t1 
699 WHERE id < 100
700 ORDER BY id;
701 id      b1      vc      bc      d       f       total   y       t       u       v
702 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      NULL    default
703 3       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      7       default
704 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      NULL    default
705 20      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      7       explicit
706 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      NULL    default
707 50      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22      NULL    explicit
708 --- Remove a record from t1 on master ---
709 DELETE FROM t1 WHERE id = 412;
710 --- Show current count on master for t1 ---
711 SELECT COUNT(*) FROM t1;
712 COUNT(*)
714 --- Show current count on slave for t1 --- 
715 SELECT COUNT(*) FROM t1;
716 COUNT(*)
718 TRUNCATE TABLE t1;
719 TRUNCATE TABLE t1;
720 --- Check that replication works when master has more columns than slave
721 --- Remove columns on slave ---
722 ALTER TABLE t1 DROP COLUMN v;
723 ALTER TABLE t1 DROP COLUMN u;
724 ALTER TABLE t1 DROP COLUMN t;
725 ALTER TABLE t1 DROP COLUMN y;
726 --- Show changed table on slave ---
727 SHOW CREATE TABLE t1;
728 Table   Create Table
729 t1      CREATE TABLE `t1` (
730   `id` mediumint(9) NOT NULL,
731   `b1` int(11) DEFAULT NULL,
732   `vc` text,
733   `bc` char(255) DEFAULT NULL,
734   `d` decimal(10,4) DEFAULT '0.0000',
735   `f` float DEFAULT '0',
736   `total` bigint(20) unsigned NOT NULL DEFAULT '0',
737   PRIMARY KEY (`id`,`total`)
738 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
739 STOP SLAVE;
740 RESET SLAVE;
741 RESET MASTER;
742 START SLAVE;
743 --- Populate t1 with data ---
744 --- Select from t1 on master --- 
745 select *
746 from t1 
747 order by id;
748 id      b1      vc      bc      d       f       total   y       t
749 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1965-11-14
750 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1985-11-14
751 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1905-11-14
752 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    1995-11-14
753 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0       1965    2005-11-14
754 --- Select from t1 on slave ---
755 select *
756 from t1 
757 order by id;
758 id      b1      vc      bc      d       f       total
759 2       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
760 4       1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
761 42      1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
762 142     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
763 412     1       Testing MySQL databases is a cool       Must make it bug free for the customer  654321.4321     15.21   0
764 --- Perform basic operation on master ---
765 --- and ensure replicated correctly ---
766 --- Update t1 on master --
767 UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" 
768 WHERE id < 100 
769 ORDER BY id;
770 --- Check the update on master --- 
771 SELECT *
772 FROM t1 
773 WHERE id < 100
774 ORDER BY id;
775 id      b1      vc      bc      d       f       total   y       t
776 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
777 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
778 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0       1965    2006-02-22
779 --- Check Update on slave ---
780 SELECT *
781 FROM t1 
782 WHERE id < 100
783 ORDER BY id;
784 id      b1      vc      bc      d       f       total
785 2       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0
786 4       0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0
787 42      0       Testing MySQL databases is a cool       updated 654321.4321     15.21   0
788 --- Remove a record from t1 on master ---
789 DELETE FROM t1 WHERE id = 412;
790 --- Show current count on master for t1 ---
791 SELECT COUNT(*) FROM t1;
792 COUNT(*)
794 --- Show current count on slave for t1 --- 
795 SELECT COUNT(*) FROM t1;
796 COUNT(*)
798 TRUNCATE TABLE t1;
799 TRUNCATE TABLE t1;
800 --- Do Cleanup --
801 DROP TABLE IF EXISTS t1;
802 drop table mysql.ndb_apply_status;
803 set @@global.slave_exec_mode= @old_slave_exec_mode;
804 include/rpl_end.inc