Debian Codegraph @

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