Debian Codegraph @

mysql-test/suite/ndb_rpl/r/ndb_rpl_innodb2ndb.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 SET default_storage_engine=innodb;
7 supports_native_partitioning: 1
8 --- Start test 1 Basic testing ---
9 --- Create Table Section ---
10 CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
11 bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
12 f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
13 y YEAR, t DATE,PRIMARY KEY(id));
14 --- Show table on master ---
15 SHOW CREATE TABLE t1;
16 Table Create Table
17 t1 CREATE TABLE `t1` (
18 `id` mediumint NOT NULL,
19 `b1` bit(8) DEFAULT NULL,
20 `vc` varchar(255) DEFAULT NULL,
21 `bc` char(255) DEFAULT NULL,
22 `d` decimal(10,4) DEFAULT '0.0000',
23 `f` float DEFAULT '0',
24 `total` bigint unsigned DEFAULT NULL,
25 `y` year DEFAULT NULL,
26 `t` date DEFAULT NULL,
27 PRIMARY KEY (`id`)
28 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
29 --- Show table on slave ---
30 SHOW CREATE TABLE t1;
31 Table Create Table
32 t1 CREATE TABLE `t1` (
33 `id` mediumint NOT NULL,
34 `b1` bit(8) DEFAULT NULL,
35 `vc` varchar(255) DEFAULT NULL,
36 `bc` char(255) DEFAULT NULL,
37 `d` decimal(10,4) DEFAULT '0.0000',
38 `f` float DEFAULT '0',
39 `total` bigint unsigned DEFAULT NULL,
40 `y` year DEFAULT NULL,
41 `t` date DEFAULT NULL,
42 PRIMARY KEY (`id`)
43 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
44 --- Perform basic operation on master ---
45 --- and ensure replicated correctly ---
46 "--- Insert into t1 --" as "";
47 --- Select from t1 on master ---
48 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
49 id hex(b1) vc bc d f total y t
50 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
51 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
52 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
53 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
54 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
55 --- Select from t1 on slave ---
56 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
57 id hex(b1) vc bc d f total y t
58 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
59 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
60 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
61 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
62 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
63 --- Update t1 on master --
64 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
65 --- Check the update on master ---
66 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
67 id hex(b1) vc bc d f total y t
68 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
69 --- Check Update on slave ---
70 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
71 id hex(b1) vc bc d f total y t
72 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
73 --- Remove a record from t1 on master ---
74 DELETE FROM t1 WHERE id = 42;
75 --- Show current count on master for t1 ---
76 SELECT COUNT(*) FROM t1;
77 COUNT(*)
78 4
79 --- Show current count on slave for t1 ---
80 SELECT COUNT(*) FROM t1;
81 COUNT(*)
82 4
83 DELETE FROM t1;
84 --- Check that simple Alter statements are replicated correctly --
85 ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
86 ALTER TABLE t1 MODIFY vc TEXT;
87 --- Show the new improved table on the master ---
88 SHOW CREATE TABLE t1;
89 Table Create Table
90 t1 CREATE TABLE `t1` (
91 `id` mediumint NOT NULL,
92 `b1` bit(8) DEFAULT NULL,
93 `vc` text,
94 `bc` char(255) DEFAULT NULL,
95 `d` decimal(10,4) DEFAULT '0.0000',
96 `f` float DEFAULT '0',
97 `total` bigint unsigned NOT NULL,
98 `y` year DEFAULT NULL,
99 `t` date DEFAULT NULL,
100 PRIMARY KEY (`id`,`total`)
101 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
102 --- Make sure that our tables on slave are still same engine ---
103 --- and that the alter statements replicated correctly ---
104 SHOW CREATE TABLE t1;
105 Table Create Table
106 t1 CREATE TABLE `t1` (
107 `id` mediumint NOT NULL,
108 `b1` bit(8) DEFAULT NULL,
109 `vc` text,
110 `bc` char(255) DEFAULT NULL,
111 `d` decimal(10,4) DEFAULT '0.0000',
112 `f` float DEFAULT '0',
113 `total` bigint unsigned NOT NULL,
114 `y` year DEFAULT NULL,
115 `t` date DEFAULT NULL,
116 PRIMARY KEY (`id`,`total`)
117 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
118 --- Perform basic operation on master ---
119 --- and ensure replicated correctly ---
120 "--- Insert into t1 --" as "";
121 --- Select from t1 on master ---
122 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
123 id hex(b1) vc bc d f total y t
124 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
125 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
126 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
127 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
128 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
129 --- Select from t1 on slave ---
130 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
131 id hex(b1) vc bc d f total y t
132 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
133 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
134 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
135 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
136 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
137 --- Update t1 on master --
138 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
139 --- Check the update on master ---
140 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
141 id hex(b1) vc bc d f total y t
142 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
143 --- Check Update on slave ---
144 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
145 id hex(b1) vc bc d f total y t
146 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
147 --- Remove a record from t1 on master ---
148 DELETE FROM t1 WHERE id = 42;
149 --- Show current count on master for t1 ---
150 SELECT COUNT(*) FROM t1;
151 COUNT(*)
152 4
153 --- Show current count on slave for t1 ---
154 SELECT COUNT(*) FROM t1;
155 COUNT(*)
156 4
157 DELETE FROM t1;
158 --- End test 1 Basic testing ---
159 --- Do Cleanup --
160 DROP TABLE IF EXISTS t1;
161 --- Start test 2 partition RANGE testing --
162 --- Do setup --
163 CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
164 bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
165 f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
166 y YEAR, t DATE, primary key(t))
167 PARTITION BY RANGE (YEAR(t))
168 (PARTITION p0 VALUES LESS THAN (1901),
169 PARTITION p1 VALUES LESS THAN (1946),
170 PARTITION p2 VALUES LESS THAN (1966),
171 PARTITION p3 VALUES LESS THAN (1986),
172 PARTITION p4 VALUES LESS THAN (2005),
173 PARTITION p5 VALUES LESS THAN MAXVALUE);
174 --- Show table on master ---
175 SHOW CREATE TABLE t1;
176 Table Create Table
177 t1 CREATE TABLE `t1` (
178 `id` mediumint NOT NULL,
179 `b1` bit(8) DEFAULT NULL,
180 `vc` varchar(255) DEFAULT NULL,
181 `bc` char(255) DEFAULT NULL,
182 `d` decimal(10,4) DEFAULT '0.0000',
183 `f` float DEFAULT '0',
184 `total` bigint unsigned DEFAULT NULL,
185 `y` year DEFAULT NULL,
186 `t` date NOT NULL,
187 PRIMARY KEY (`t`)
188 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
189 /*!50100 PARTITION BY RANGE (year(`t`))
190 (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB,
191 PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB,
192 PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB,
193 PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB,
194 PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB,
195 PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
196 --- Show table on slave --
197 SHOW CREATE TABLE t1;
198 Table Create Table
199 t1 CREATE TABLE `t1` (
200 `id` mediumint NOT NULL,
201 `b1` bit(8) DEFAULT NULL,
202 `vc` varchar(255) DEFAULT NULL,
203 `bc` char(255) DEFAULT NULL,
204 `d` decimal(10,4) DEFAULT '0.0000',
205 `f` float DEFAULT '0',
206 `total` bigint unsigned DEFAULT NULL,
207 `y` year DEFAULT NULL,
208 `t` date NOT NULL,
209 PRIMARY KEY (`t`)
210 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
211 /*!50100 PARTITION BY RANGE (year(`t`))
212 (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
213 PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
214 PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
215 PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
216 PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
217 PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
218 --- Perform basic operation on master ---
219 --- and ensure replicated correctly ---
220 "--- Insert into t1 --" as "";
221 --- Select from t1 on master ---
222 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
223 id hex(b1) vc bc d f total y t
224 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
225 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
226 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
227 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
228 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
229 --- Select from t1 on slave ---
230 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
231 id hex(b1) vc bc d f total y t
232 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
233 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
234 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
235 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
236 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
237 --- Update t1 on master --
238 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
239 --- Check the update on master ---
240 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
241 id hex(b1) vc bc d f total y t
242 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
243 --- Check Update on slave ---
244 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
245 id hex(b1) vc bc d f total y t
246 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
247 --- Remove a record from t1 on master ---
248 DELETE FROM t1 WHERE id = 42;
249 --- Show current count on master for t1 ---
250 SELECT COUNT(*) FROM t1;
251 COUNT(*)
252 4
253 --- Show current count on slave for t1 ---
254 SELECT COUNT(*) FROM t1;
255 COUNT(*)
256 4
257 DELETE FROM t1;
258 --- Check that simple Alter statements are replicated correctly ---
259 ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(t, id);
260 ALTER TABLE t1 MODIFY vc TEXT;
261 --- Show the new improved table on the master ---
262 SHOW CREATE TABLE t1;
263 Table Create Table
264 t1 CREATE TABLE `t1` (
265 `id` mediumint NOT NULL,
266 `b1` bit(8) DEFAULT NULL,
267 `vc` text,
268 `bc` char(255) DEFAULT NULL,
269 `d` decimal(10,4) DEFAULT '0.0000',
270 `f` float DEFAULT '0',
271 `total` bigint unsigned DEFAULT NULL,
272 `y` year DEFAULT NULL,
273 `t` date NOT NULL,
274 PRIMARY KEY (`t`,`id`)
275 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
276 /*!50100 PARTITION BY RANGE (year(`t`))
277 (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB,
278 PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB,
279 PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB,
280 PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB,
281 PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB,
282 PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
283 --- Make sure that our tables on slave are still same engine ---
284 --- and that the alter statements replicated correctly ---
285 SHOW CREATE TABLE t1;
286 Table Create Table
287 t1 CREATE TABLE `t1` (
288 `id` mediumint NOT NULL,
289 `b1` bit(8) DEFAULT NULL,
290 `vc` text,
291 `bc` char(255) DEFAULT NULL,
292 `d` decimal(10,4) DEFAULT '0.0000',
293 `f` float DEFAULT '0',
294 `total` bigint unsigned DEFAULT NULL,
295 `y` year DEFAULT NULL,
296 `t` date NOT NULL,
297 PRIMARY KEY (`t`,`id`)
298 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
299 /*!50100 PARTITION BY RANGE (year(`t`))
300 (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster,
301 PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster,
302 PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
303 PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster,
304 PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster,
305 PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */
306 --- Perform basic operation on master ---
307 --- and ensure replicated correctly ---
308 "--- Insert into t1 --" as "";
309 --- Select from t1 on master ---
310 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
311 id hex(b1) vc bc d f total y t
312 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
313 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
314 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
315 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
316 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
317 --- Select from t1 on slave ---
318 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
319 id hex(b1) vc bc d f total y t
320 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
321 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
322 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
323 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
324 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
325 --- Update t1 on master --
326 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
327 --- Check the update on master ---
328 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
329 id hex(b1) vc bc d f total y t
330 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
331 --- Check Update on slave ---
332 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
333 id hex(b1) vc bc d f total y t
334 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
335 --- Remove a record from t1 on master ---
336 DELETE FROM t1 WHERE id = 42;
337 --- Show current count on master for t1 ---
338 SELECT COUNT(*) FROM t1;
339 COUNT(*)
340 4
341 --- Show current count on slave for t1 ---
342 SELECT COUNT(*) FROM t1;
343 COUNT(*)
344 4
345 DELETE FROM t1;
346 --- End test 2 partition RANGE testing ---
347 --- Do Cleanup ---
348 DROP TABLE t1;
349 --- Start test 3 partition LIST testing ---
350 --- Do setup ---
351 CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
352 bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
353 f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
354 y YEAR, t DATE, primary key(id))
355 PARTITION BY LIST(id)
356 (PARTITION p0 VALUES IN (2, 4),
357 PARTITION p1 VALUES IN (42, 142));
358 --- Test 3 Alter to add partition ---
359 ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
360 --- Show table on master ---
361 SHOW CREATE TABLE t1;
362 Table Create Table
363 t1 CREATE TABLE `t1` (
364 `id` mediumint NOT NULL,
365 `b1` bit(8) DEFAULT NULL,
366 `vc` varchar(255) DEFAULT NULL,
367 `bc` char(255) DEFAULT NULL,
368 `d` decimal(10,4) DEFAULT '0.0000',
369 `f` float DEFAULT '0',
370 `total` bigint unsigned DEFAULT NULL,
371 `y` year DEFAULT NULL,
372 `t` date DEFAULT NULL,
373 PRIMARY KEY (`id`)
374 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
375 /*!50100 PARTITION BY LIST (`id`)
376 (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB,
377 PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB,
378 PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
379 --- Show table on slave ---
380 SHOW CREATE TABLE t1;
381 Table Create Table
382 t1 CREATE TABLE `t1` (
383 `id` mediumint NOT NULL,
384 `b1` bit(8) DEFAULT NULL,
385 `vc` varchar(255) DEFAULT NULL,
386 `bc` char(255) DEFAULT NULL,
387 `d` decimal(10,4) DEFAULT '0.0000',
388 `f` float DEFAULT '0',
389 `total` bigint unsigned DEFAULT NULL,
390 `y` year DEFAULT NULL,
391 `t` date DEFAULT NULL,
392 PRIMARY KEY (`id`)
393 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
394 /*!50100 PARTITION BY LIST (`id`)
395 (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
396 PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
397 PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
398 --- Perform basic operation on master ---
399 --- and ensure replicated correctly ---
400 "--- Insert into t1 --" as "";
401 --- Select from t1 on master ---
402 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
403 id hex(b1) vc bc d f total y t
404 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
405 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
406 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
407 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
408 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
409 --- Select from t1 on slave ---
410 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
411 id hex(b1) vc bc d f total y t
412 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
413 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
414 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
415 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
416 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
417 --- Update t1 on master --
418 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
419 --- Check the update on master ---
420 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
421 id hex(b1) vc bc d f total y t
422 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
423 --- Check Update on slave ---
424 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
425 id hex(b1) vc bc d f total y t
426 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
427 --- Remove a record from t1 on master ---
428 DELETE FROM t1 WHERE id = 42;
429 --- Show current count on master for t1 ---
430 SELECT COUNT(*) FROM t1;
431 COUNT(*)
432 4
433 --- Show current count on slave for t1 ---
434 SELECT COUNT(*) FROM t1;
435 COUNT(*)
436 4
437 DELETE FROM t1;
438 --- Check that simple Alter statements are replicated correctly ---
439 ALTER TABLE t1 MODIFY vc TEXT;
440 --- Show the new improved table on the master ---
441 SHOW CREATE TABLE t1;
442 Table Create Table
443 t1 CREATE TABLE `t1` (
444 `id` mediumint NOT NULL,
445 `b1` bit(8) DEFAULT NULL,
446 `vc` text,
447 `bc` char(255) DEFAULT NULL,
448 `d` decimal(10,4) DEFAULT '0.0000',
449 `f` float DEFAULT '0',
450 `total` bigint unsigned DEFAULT NULL,
451 `y` year DEFAULT NULL,
452 `t` date DEFAULT NULL,
453 PRIMARY KEY (`id`)
454 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
455 /*!50100 PARTITION BY LIST (`id`)
456 (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB,
457 PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB,
458 PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
459 --- Make sure that our tables on slave are still same engine ---
460 --- and that the alter statements replicated correctly ---
461 SHOW CREATE TABLE t1;
462 Table Create Table
463 t1 CREATE TABLE `t1` (
464 `id` mediumint NOT NULL,
465 `b1` bit(8) DEFAULT NULL,
466 `vc` text,
467 `bc` char(255) DEFAULT NULL,
468 `d` decimal(10,4) DEFAULT '0.0000',
469 `f` float DEFAULT '0',
470 `total` bigint unsigned DEFAULT NULL,
471 `y` year DEFAULT NULL,
472 `t` date DEFAULT NULL,
473 PRIMARY KEY (`id`)
474 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
475 /*!50100 PARTITION BY LIST (`id`)
476 (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster,
477 PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster,
478 PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
479 --- Perform basic operation on master ---
480 --- and ensure replicated correctly ---
481 "--- Insert into t1 --" as "";
482 --- Select from t1 on master ---
483 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
484 id hex(b1) vc bc d f total y t
485 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
486 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
487 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
488 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
489 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
490 --- Select from t1 on slave ---
491 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
492 id hex(b1) vc bc d f total y t
493 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
494 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
495 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
496 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
497 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
498 --- Update t1 on master --
499 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
500 --- Check the update on master ---
501 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
502 id hex(b1) vc bc d f total y t
503 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
504 --- Check Update on slave ---
505 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
506 id hex(b1) vc bc d f total y t
507 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
508 --- Remove a record from t1 on master ---
509 DELETE FROM t1 WHERE id = 42;
510 --- Show current count on master for t1 ---
511 SELECT COUNT(*) FROM t1;
512 COUNT(*)
513 4
514 --- Show current count on slave for t1 ---
515 SELECT COUNT(*) FROM t1;
516 COUNT(*)
517 4
518 DELETE FROM t1;
519 --- End test 3 partition LIST testing ---
520 --- Do Cleanup --
521 DROP TABLE t1;
522 --- Start test 4 partition HASH testing ---
523 --- Do setup ---
524 CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
525 bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
526 f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
527 y YEAR, t DATE, primary key(t))
528 PARTITION BY HASH( YEAR(t) )
529 PARTITIONS 4;
530 --- show that tables have been created correctly ---
531 SHOW CREATE TABLE t1;
532 Table Create Table
533 t1 CREATE TABLE `t1` (
534 `id` mediumint NOT NULL,
535 `b1` bit(8) DEFAULT NULL,
536 `vc` varchar(255) DEFAULT NULL,
537 `bc` char(255) DEFAULT NULL,
538 `d` decimal(10,4) DEFAULT '0.0000',
539 `f` float DEFAULT '0',
540 `total` bigint unsigned DEFAULT NULL,
541 `y` year DEFAULT NULL,
542 `t` date NOT NULL,
543 PRIMARY KEY (`t`)
544 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
545 /*!50100 PARTITION BY HASH (year(`t`))
546 PARTITIONS 4 */
547 SHOW CREATE TABLE t1;
548 Table Create Table
549 t1 CREATE TABLE `t1` (
550 `id` mediumint NOT NULL,
551 `b1` bit(8) DEFAULT NULL,
552 `vc` varchar(255) DEFAULT NULL,
553 `bc` char(255) DEFAULT NULL,
554 `d` decimal(10,4) DEFAULT '0.0000',
555 `f` float DEFAULT '0',
556 `total` bigint unsigned DEFAULT NULL,
557 `y` year DEFAULT NULL,
558 `t` date NOT NULL,
559 PRIMARY KEY (`t`)
560 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
561 /*!50100 PARTITION BY HASH (year(`t`))
562 PARTITIONS 4 */
563 --- Perform basic operation on master ---
564 --- and ensure replicated correctly ---
565 "--- Insert into t1 --" as "";
566 --- Select from t1 on master ---
567 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
568 id hex(b1) vc bc d f total y t
569 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
570 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
571 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
572 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
573 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
574 --- Select from t1 on slave ---
575 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
576 id hex(b1) vc bc d f total y t
577 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
578 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
579 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
580 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
581 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
582 --- Update t1 on master --
583 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
584 --- Check the update on master ---
585 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
586 id hex(b1) vc bc d f total y t
587 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
588 --- Check Update on slave ---
589 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
590 id hex(b1) vc bc d f total y t
591 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
592 --- Remove a record from t1 on master ---
593 DELETE FROM t1 WHERE id = 42;
594 --- Show current count on master for t1 ---
595 SELECT COUNT(*) FROM t1;
596 COUNT(*)
597 4
598 --- Show current count on slave for t1 ---
599 SELECT COUNT(*) FROM t1;
600 COUNT(*)
601 4
602 DELETE FROM t1;
603 --- Check that simple Alter statements are replicated correctly ---
604 ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(t,id);
605 ALTER TABLE t1 MODIFY vc TEXT;
606 --- Show the new improved table on the master ---
607 SHOW CREATE TABLE t1;
608 Table Create Table
609 t1 CREATE TABLE `t1` (
610 `id` mediumint NOT NULL,
611 `b1` bit(8) DEFAULT NULL,
612 `vc` text,
613 `bc` char(255) DEFAULT NULL,
614 `d` decimal(10,4) DEFAULT '0.0000',
615 `f` float DEFAULT '0',
616 `total` bigint unsigned DEFAULT NULL,
617 `y` year DEFAULT NULL,
618 `t` date NOT NULL,
619 PRIMARY KEY (`t`,`id`)
620 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
621 /*!50100 PARTITION BY HASH (year(`t`))
622 PARTITIONS 4 */
623 --- Make sure that our tables on slave are still same engine ---
624 --- and that the alter statements replicated correctly ---
625 SHOW CREATE TABLE t1;
626 Table Create Table
627 t1 CREATE TABLE `t1` (
628 `id` mediumint NOT NULL,
629 `b1` bit(8) DEFAULT NULL,
630 `vc` text,
631 `bc` char(255) DEFAULT NULL,
632 `d` decimal(10,4) DEFAULT '0.0000',
633 `f` float DEFAULT '0',
634 `total` bigint unsigned DEFAULT NULL,
635 `y` year DEFAULT NULL,
636 `t` date NOT NULL,
637 PRIMARY KEY (`t`,`id`)
638 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
639 /*!50100 PARTITION BY HASH (year(`t`))
640 PARTITIONS 4 */
641 --- Perform basic operation on master ---
642 --- and ensure replicated correctly ---
643 "--- Insert into t1 --" as "";
644 --- Select from t1 on master ---
645 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
646 id hex(b1) vc bc d f total y t
647 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
648 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
649 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
650 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
651 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
652 --- Select from t1 on slave ---
653 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
654 id hex(b1) vc bc d f total y t
655 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
656 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
657 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
658 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
659 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
660 --- Update t1 on master --
661 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
662 --- Check the update on master ---
663 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
664 id hex(b1) vc bc d f total y t
665 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
666 --- Check Update on slave ---
667 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
668 id hex(b1) vc bc d f total y t
669 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
670 --- Remove a record from t1 on master ---
671 DELETE FROM t1 WHERE id = 42;
672 --- Show current count on master for t1 ---
673 SELECT COUNT(*) FROM t1;
674 COUNT(*)
675 4
676 --- Show current count on slave for t1 ---
677 SELECT COUNT(*) FROM t1;
678 COUNT(*)
679 4
680 DELETE FROM t1;
681 --- End test 4 partition HASH testing ---
682 --- Do Cleanup --
683 DROP TABLE t1;
684 --- Start test 5 partition by key testing ---
685 --- Create Table Section ---
686 CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
687 bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
688 f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
689 y YEAR, t DATE,PRIMARY KEY(id))
690 PARTITION BY KEY()
691 PARTITIONS 4;
692 --- Show that tables on master are ndbcluster tables ---
693 SHOW CREATE TABLE t1;
694 Table Create Table
695 t1 CREATE TABLE `t1` (
696 `id` mediumint NOT NULL,
697 `b1` bit(8) DEFAULT NULL,
698 `vc` varchar(255) DEFAULT NULL,
699 `bc` char(255) DEFAULT NULL,
700 `d` decimal(10,4) DEFAULT '0.0000',
701 `f` float DEFAULT '0',
702 `total` bigint unsigned DEFAULT NULL,
703 `y` year DEFAULT NULL,
704 `t` date DEFAULT NULL,
705 PRIMARY KEY (`id`)
706 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
707 /*!50100 PARTITION BY KEY ()
708 PARTITIONS 4 */
709 --- Show that tables on slave ---
710 SHOW CREATE TABLE t1;
711 Table Create Table
712 t1 CREATE TABLE `t1` (
713 `id` mediumint NOT NULL,
714 `b1` bit(8) DEFAULT NULL,
715 `vc` varchar(255) DEFAULT NULL,
716 `bc` char(255) DEFAULT NULL,
717 `d` decimal(10,4) DEFAULT '0.0000',
718 `f` float DEFAULT '0',
719 `total` bigint unsigned DEFAULT NULL,
720 `y` year DEFAULT NULL,
721 `t` date DEFAULT NULL,
722 PRIMARY KEY (`id`)
723 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
724 /*!50100 PARTITION BY KEY ()
725 PARTITIONS 4 */
726 --- Perform basic operation on master ---
727 --- and ensure replicated correctly ---
728 "--- Insert into t1 --" as "";
729 --- Select from t1 on master ---
730 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
731 id hex(b1) vc bc d f total y t
732 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
733 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
734 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
735 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
736 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
737 --- Select from t1 on slave ---
738 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
739 id hex(b1) vc bc d f total y t
740 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
741 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
742 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
743 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
744 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
745 --- Update t1 on master --
746 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
747 --- Check the update on master ---
748 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
749 id hex(b1) vc bc d f total y t
750 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
751 --- Check Update on slave ---
752 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
753 id hex(b1) vc bc d f total y t
754 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
755 --- Remove a record from t1 on master ---
756 DELETE FROM t1 WHERE id = 42;
757 --- Show current count on master for t1 ---
758 SELECT COUNT(*) FROM t1;
759 COUNT(*)
760 4
761 --- Show current count on slave for t1 ---
762 SELECT COUNT(*) FROM t1;
763 COUNT(*)
764 4
765 DELETE FROM t1;
766 --- Check that simple Alter statements are replicated correctly ---
767 ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
768 --- Show the new improved table on the master ---
769 SHOW CREATE TABLE t1;
770 Table Create Table
771 t1 CREATE TABLE `t1` (
772 `id` mediumint NOT NULL,
773 `b1` bit(8) DEFAULT NULL,
774 `vc` varchar(255) DEFAULT NULL,
775 `bc` char(255) DEFAULT NULL,
776 `d` decimal(10,4) DEFAULT '0.0000',
777 `f` float DEFAULT '0',
778 `total` bigint unsigned NOT NULL,
779 `y` year DEFAULT NULL,
780 `t` date DEFAULT NULL,
781 PRIMARY KEY (`id`,`total`)
782 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
783 /*!50100 PARTITION BY KEY ()
784 PARTITIONS 4 */
785 --- Make sure that our tables on slave are still right type ---
786 --- and that the alter statements replicated correctly ---
787 SHOW CREATE TABLE t1;
788 Table Create Table
789 t1 CREATE TABLE `t1` (
790 `id` mediumint NOT NULL,
791 `b1` bit(8) DEFAULT NULL,
792 `vc` varchar(255) DEFAULT NULL,
793 `bc` char(255) DEFAULT NULL,
794 `d` decimal(10,4) DEFAULT '0.0000',
795 `f` float DEFAULT '0',
796 `total` bigint unsigned NOT NULL,
797 `y` year DEFAULT NULL,
798 `t` date DEFAULT NULL,
799 PRIMARY KEY (`id`,`total`)
800 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
801 /*!50100 PARTITION BY KEY ()
802 PARTITIONS 4 */
803 --- Perform basic operation on master ---
804 --- and ensure replicated correctly ---
805 "--- Insert into t1 --" as "";
806 --- Select from t1 on master ---
807 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
808 id hex(b1) vc bc d f total y t
809 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
810 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
811 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
812 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
813 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
814 --- Select from t1 on slave ---
815 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
816 id hex(b1) vc bc d f total y t
817 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
818 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
819 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
820 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
821 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
822 --- Update t1 on master --
823 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
824 --- Check the update on master ---
825 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
826 id hex(b1) vc bc d f total y t
827 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
828 --- Check Update on slave ---
829 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
830 id hex(b1) vc bc d f total y t
831 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
832 --- Remove a record from t1 on master ---
833 DELETE FROM t1 WHERE id = 42;
834 --- Show current count on master for t1 ---
835 SELECT COUNT(*) FROM t1;
836 COUNT(*)
837 4
838 --- Show current count on slave for t1 ---
839 SELECT COUNT(*) FROM t1;
840 COUNT(*)
841 4
842 DELETE FROM t1;
843 --- Check that simple Alter statements are replicated correctly ---
844 ALTER TABLE t1 MODIFY vc TEXT;
845 --- Show the new improved table on the master ---
846 SHOW CREATE TABLE t1;
847 Table Create Table
848 t1 CREATE TABLE `t1` (
849 `id` mediumint NOT NULL,
850 `b1` bit(8) DEFAULT NULL,
851 `vc` text,
852 `bc` char(255) DEFAULT NULL,
853 `d` decimal(10,4) DEFAULT '0.0000',
854 `f` float DEFAULT '0',
855 `total` bigint unsigned NOT NULL,
856 `y` year DEFAULT NULL,
857 `t` date DEFAULT NULL,
858 PRIMARY KEY (`id`,`total`)
859 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
860 /*!50100 PARTITION BY KEY ()
861 PARTITIONS 4 */
862 --- Make sure that our tables on slave are still same engine ---
863 --- and that the alter statements replicated correctly ---
864 SHOW CREATE TABLE t1;
865 Table Create Table
866 t1 CREATE TABLE `t1` (
867 `id` mediumint NOT NULL,
868 `b1` bit(8) DEFAULT NULL,
869 `vc` text,
870 `bc` char(255) DEFAULT NULL,
871 `d` decimal(10,4) DEFAULT '0.0000',
872 `f` float DEFAULT '0',
873 `total` bigint unsigned NOT NULL,
874 `y` year DEFAULT NULL,
875 `t` date DEFAULT NULL,
876 PRIMARY KEY (`id`,`total`)
877 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
878 /*!50100 PARTITION BY KEY ()
879 PARTITIONS 4 */
880 --- Perform basic operation on master ---
881 --- and ensure replicated correctly ---
882 "--- Insert into t1 --" as "";
883 --- Select from t1 on master ---
884 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
885 id hex(b1) vc bc d f total y t
886 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
887 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
888 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
889 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
890 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
891 --- Select from t1 on slave ---
892 select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
893 id hex(b1) vc bc d f total y t
894 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
895 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
896 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
897 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
898 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
899 --- Update t1 on master --
900 UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
901 --- Check the update on master ---
902 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
903 id hex(b1) vc bc d f total y t
904 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
905 --- Check Update on slave ---
906 SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
907 id hex(b1) vc bc d f total y t
908 412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
909 --- Remove a record from t1 on master ---
910 DELETE FROM t1 WHERE id = 42;
911 --- Show current count on master for t1 ---
912 SELECT COUNT(*) FROM t1;
913 COUNT(*)
914 4
915 --- Show current count on slave for t1 ---
916 SELECT COUNT(*) FROM t1;
917 COUNT(*)
918 4
919 DELETE FROM t1;
920 --- End test 5 key partition testing ---
921 --- Do Cleanup ---
922 DROP TABLE t1;
923 include/rpl_end.inc