Debian Codegraph @

mysql-test/suite/rpl/include/type_conversions.test

raw
1 # File containing different lossy and non-lossy type conversions.
2
3 # Integral conversion testing, we do not reduce the test using
4 # transitivity of conversions since the implementation is not using a
5 # transitivity strategy. Instead we do an exhaustive testing.
6
7 disable_query_log;
8 connection slave;
9 --let $conv = `select @@slave_type_conversions`
10 --echo **** Running tests with @@SLAVE_TYPE_CONVERSIONS = '$conv' ****
11
12 let $if_is_lossy = `SELECT FIND_IN_SET('ALL_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`;
13 let $if_is_non_lossy = `SELECT FIND_IN_SET('ALL_NON_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`;
14
15 # TINYBLOB
16
17 let $source_type = TINYBLOB;
18 let $target_type = TINYBLOB;
19 let $source_value = 'aaa';
20 let $target_value = 'aaa';
21 let $can_convert = 1;
22 source suite/rpl/include/check_type.inc;
23
24 let $source_type= TINYBLOB;
25 let $target_type= BLOB;
26 let $source_value= 'aaa';
27 let $target_value= 'aaa';
28 let $can_convert= $if_is_non_lossy;
29 source suite/rpl/include/check_type.inc;
30
31 let $source_type= TINYBLOB;
32 let $target_type= MEDIUMBLOB;
33 let $source_value= 'aaa';
34 let $target_value= 'aaa';
35 let $can_convert= $if_is_non_lossy;
36 source suite/rpl/include/check_type.inc;
37
38 let $source_type= TINYBLOB;
39 let $target_type= LONGBLOB;
40 let $source_value= 'aaa';
41 let $target_value= 'aaa';
42 let $can_convert= $if_is_non_lossy;
43 source suite/rpl/include/check_type.inc;
44
45 # BLOB
46
47 let $source_type = BLOB;
48 let $target_type = TINYBLOB;
49 let $source_value = 'aaa';
50 let $target_value = 'aaa';
51 let $can_convert = $if_is_lossy;
52 source suite/rpl/include/check_type.inc;
53
54 let $source_type= BLOB;
55 let $target_type= BLOB;
56 let $source_value= 'aaa';
57 let $target_value= 'aaa';
58 let $can_convert= 1;
59 source suite/rpl/include/check_type.inc;
60
61 let $source_type= BLOB;
62 let $target_type= MEDIUMBLOB;
63 let $source_value= 'aaa';
64 let $target_value= 'aaa';
65 let $can_convert= $if_is_non_lossy;
66 source suite/rpl/include/check_type.inc;
67
68 let $source_type= BLOB;
69 let $target_type= LONGBLOB;
70 let $source_value= 'aaa';
71 let $target_value= 'aaa';
72 let $can_convert= $if_is_non_lossy;
73 source suite/rpl/include/check_type.inc;
74
75 # MEDIUMBLOB
76
77 let $source_type = MEDIUMBLOB;
78 let $target_type = TINYBLOB;
79 let $source_value = 'aaa';
80 let $target_value = 'aaa';
81 let $can_convert = $if_is_lossy;
82 source suite/rpl/include/check_type.inc;
83
84 let $source_type= MEDIUMBLOB;
85 let $target_type= BLOB;
86 let $source_value= 'aaa';
87 let $target_value= 'aaa';
88 let $can_convert= $if_is_lossy;
89 source suite/rpl/include/check_type.inc;
90
91 let $source_type= MEDIUMBLOB;
92 let $target_type= MEDIUMBLOB;
93 let $source_value= 'aaa';
94 let $target_value= 'aaa';
95 let $can_convert= 1;
96 source suite/rpl/include/check_type.inc;
97
98 let $source_type= MEDIUMBLOB;
99 let $target_type= LONGBLOB;
100 let $source_value= 'aaa';
101 let $target_value= 'aaa';
102 let $can_convert= $if_is_non_lossy;
103 source suite/rpl/include/check_type.inc;
104
105 # LONGBLOB
106
107 let $source_type = LONGBLOB;
108 let $target_type = TINYBLOB;
109 let $source_value = 'aaa';
110 let $target_value = 'aaa';
111 let $can_convert = $if_is_lossy;
112 source suite/rpl/include/check_type.inc;
113
114 let $source_type= LONGBLOB;
115 let $target_type= BLOB;
116 let $source_value= 'aaa';
117 let $target_value= 'aaa';
118 let $can_convert= $if_is_lossy;
119 source suite/rpl/include/check_type.inc;
120
121 let $source_type= LONGBLOB;
122 let $target_type= MEDIUMBLOB;
123 let $source_value= 'aaa';
124 let $target_value= 'aaa';
125 let $can_convert= $if_is_lossy;
126 source suite/rpl/include/check_type.inc;
127
128 let $source_type= LONGBLOB;
129 let $target_type= LONGBLOB;
130 let $source_value= 'aaa';
131 let $target_value= 'aaa';
132 let $can_convert= 1;
133 source suite/rpl/include/check_type.inc;
134
135 # BUG#49836 (additional tests - GEOMETRY TYPE)
136
137 let $source_type = GEOMETRY;
138 let $target_type = BLOB;
139 let $source_value = PointFromText('POINT(10 10)');
140 let $target_value = PointFromText('POINT(10 10)');
141 let $can_convert = 0;
142 source suite/rpl/include/check_type.inc;
143
144 let $source_type = BLOB;
145 let $target_type = GEOMETRY;
146 let $source_value = 'aaa';
147 let $target_value = 'aaa';
148 let $can_convert = 0;
149 source suite/rpl/include/check_type.inc;
150
151 let $source_type = GEOMETRY;
152 let $target_type = GEOMETRY;
153 let $source_value = PointFromText('POINT(10 10)');
154 let $target_value = PointFromText('POINT(10 10)');
155 let $can_convert = 1;
156 source suite/rpl/include/check_type.inc;
157
158 let $source_type = BIT(1);
159 let $target_type = BIT(1);
160 let $source_value = b'1';
161 let $target_value = b'1';
162 let $can_convert = 1;
163 source suite/rpl/include/check_type.inc;
164
165 let $source_type = DATE;
166 let $target_type = DATE;
167 let $source_value = '2009-11-21';
168 let $target_value = '2009-11-21';
169 let $can_convert = 1;
170 source suite/rpl/include/check_type.inc;
171
172 let $source_type = ENUM('master','slave');
173 let $target_type = ENUM('master','slave');
174 let $source_value = 'master';
175 let $target_value = 'master';
176 let $can_convert = 1;
177 source suite/rpl/include/check_type.inc;
178
179 let $source_type = CHAR(10);
180 let $target_type = ENUM('master','slave');
181 let $source_value = 'master';
182 let $target_value = 'master';
183 let $can_convert = 0;
184 source suite/rpl/include/check_type.inc;
185
186 let $source_type = CHAR(10);
187 let $target_type = SET('master','slave');
188 let $source_value = 'master';
189 let $target_value = 'master';
190 let $can_convert = 0;
191 source suite/rpl/include/check_type.inc;
192
193 let $source_type = ENUM('master','slave');
194 let $target_type = CHAR(10);
195 let $source_value = 'master';
196 let $target_value = 'master';
197 let $can_convert = 0;
198 source suite/rpl/include/check_type.inc;
199
200 let $source_type = SET('master','slave');
201 let $target_type = CHAR(10);
202 let $source_value = 'master';
203 let $target_value = 'master';
204 let $can_convert = 0;
205 source suite/rpl/include/check_type.inc;
206
207 let $source_type = SET('master','slave');
208 let $target_type = SET('master','slave');
209 let $source_value = '';
210 let $target_value = '';
211 let $can_convert = 1;
212 source suite/rpl/include/check_type.inc;
213
214 let $source_type = SET('master','slave');
215 let $target_type = SET('master','slave');
216 let $source_value = 'master,slave';
217 let $target_value = 'master,slave';
218 let $can_convert = 1;
219 source suite/rpl/include/check_type.inc;
220
221 let $source_type = SET('0','1','2','3','4','5','6');
222 let $target_type = SET('0','1','2','3','4','5','6');
223 let $source_value = '5';
224 let $target_value = '5';
225 let $can_convert = 1;
226 source suite/rpl/include/check_type.inc;
227
228 let $source_type = SET('0','1','2','3','4','5','6');
229 let $target_type = SET('0','1','2','3','4','5','6','7','8','9','10');
230 let $source_value = '5';
231 let $target_value = '5';
232 let $can_convert = $if_is_non_lossy;
233 source suite/rpl/include/check_type.inc;
234
235 let $source_type = SET('0','1','2','3','4','5','6','7','8','9','10');
236 let $target_type = SET('0','1','2','3','4','5','6');
237 let $source_value = '5';
238 let $target_value = '5';
239 let $can_convert = $if_is_lossy;
240 source suite/rpl/include/check_type.inc;
241
242 let $source_type = SET('0','1','2','3','4','5','6','7','8','9','10');
243 let $target_type = SET('0','1','2','3','4','5','6');
244 let $source_value = '7';
245 let $target_value = '';
246 let $can_convert = $if_is_lossy;
247 source suite/rpl/include/check_type.inc;
248
249 let $source_type = TINYINT;
250 let $target_type = TINYINT;
251 let $source_value = 1;
252 let $target_value = 1;
253 let $can_convert = 1;
254 source suite/rpl/include/check_type.inc;
255
256 let $source_type = TINYINT;
257 let $target_type = SMALLINT;
258 let $source_value = 1;
259 let $target_value = 1;
260 let $can_convert = $if_is_non_lossy;
261 source suite/rpl/include/check_type.inc;
262
263 let $source_type= TINYINT;
264 let $target_type= MEDIUMINT;
265 let $source_value= 1;
266 let $target_value= 1;
267 let $can_convert = $if_is_non_lossy;
268 source suite/rpl/include/check_type.inc;
269
270 let $source_type= TINYINT;
271 let $target_type= INT;
272 let $source_value= 1;
273 let $target_value= 1;
274 let $can_convert = $if_is_non_lossy;
275 source suite/rpl/include/check_type.inc;
276
277 let $source_type= TINYINT;
278 let $target_type= BIGINT;
279 let $source_value= 1;
280 let $target_value= 1;
281 let $can_convert = $if_is_non_lossy;
282 source suite/rpl/include/check_type.inc;
283
284 let $source_type= SMALLINT;
285 let $target_type= TINYINT;
286 let $source_value= 1;
287 let $target_value= 1;
288 let $can_convert = $if_is_lossy;
289 source suite/rpl/include/check_type.inc;
290
291 let $source_type= SMALLINT;
292 let $target_type= TINYINT;
293 let $source_value= 1 << 9;
294 let $target_value= (1 << 7) - 1;
295 let $can_convert = $if_is_lossy;
296 source suite/rpl/include/check_type.inc;
297
298 let $source_type= SMALLINT;
299 let $target_type= TINYINT UNSIGNED;
300 let $source_value= 1 << 9;
301 let $target_value= (1 << 8) - 1;
302 let $can_convert = $if_is_lossy;
303 source suite/rpl/include/check_type.inc;
304
305 let $source_type= SMALLINT;
306 let $target_type= SMALLINT;
307 let $source_value= 1;
308 let $target_value= 1;
309 let $can_convert = 1;
310 source suite/rpl/include/check_type.inc;
311
312 let $source_type= SMALLINT;
313 let $target_type= MEDIUMINT;
314 let $source_value= 1;
315 let $target_value= 1;
316 let $can_convert = $if_is_non_lossy;
317 source suite/rpl/include/check_type.inc;
318
319 let $source_type= SMALLINT;
320 let $target_type= INT;
321 let $source_value= 1;
322 let $target_value= 1;
323 let $can_convert = $if_is_non_lossy;
324 source suite/rpl/include/check_type.inc;
325
326 let $source_type= SMALLINT;
327 let $target_type= BIGINT;
328 let $source_value= 1;
329 let $target_value= 1;
330 let $can_convert = $if_is_non_lossy;
331 source suite/rpl/include/check_type.inc;
332
333 let $source_type= MEDIUMINT;
334 let $target_type= TINYINT;
335 let $source_value= 1;
336 let $target_value= 1;
337 let $can_convert = $if_is_lossy;
338 source suite/rpl/include/check_type.inc;
339
340 let $source_type= MEDIUMINT;
341 let $target_type= TINYINT;
342 let $source_value= 1 << 20;
343 let $target_value= (1 << 7) - 1;
344 let $can_convert = $if_is_lossy;
345 source suite/rpl/include/check_type.inc;
346
347 let $source_type= MEDIUMINT;
348 let $target_type= TINYINT UNSIGNED;
349 let $source_value= 1 << 20;
350 let $target_value= (1 << 8) - 1;
351 let $can_convert = $if_is_lossy;
352 source suite/rpl/include/check_type.inc;
353
354 let $source_type= MEDIUMINT;
355 let $target_type= SMALLINT;
356 let $source_value= 1;
357 let $target_value= 1;
358 let $can_convert = $if_is_lossy;
359 source suite/rpl/include/check_type.inc;
360
361 let $source_type= MEDIUMINT;
362 let $target_type= MEDIUMINT;
363 let $source_value= 1;
364 let $target_value= 1;
365 let $can_convert = 1;
366 source suite/rpl/include/check_type.inc;
367
368 let $source_type= MEDIUMINT;
369 let $target_type= INT;
370 let $source_value= 1;
371 let $target_value= 1;
372 let $can_convert = $if_is_non_lossy;
373 source suite/rpl/include/check_type.inc;
374
375 let $source_type= MEDIUMINT;
376 let $target_type= BIGINT;
377 let $source_value= 1;
378 let $target_value= 1;
379 let $can_convert = $if_is_non_lossy;
380 source suite/rpl/include/check_type.inc;
381
382 let $source_type= INT;
383 let $target_type= TINYINT;
384 let $source_value= 1;
385 let $target_value= 1;
386 let $can_convert = $if_is_lossy;
387 source suite/rpl/include/check_type.inc;
388
389 let $source_type= INT;
390 let $target_type= TINYINT;
391 let $source_value= (1 << 30);
392 let $target_value= (1 << 7) - 1;
393 let $can_convert = $if_is_lossy;
394 source suite/rpl/include/check_type.inc;
395
396 let $source_type= INT;
397 let $target_type= TINYINT UNSIGNED;
398 let $source_value= (1 << 30);
399 let $target_value= (1 << 8) - 1;
400 let $can_convert = $if_is_lossy;
401 source suite/rpl/include/check_type.inc;
402
403 let $source_type= INT;
404 let $target_type= SMALLINT;
405 let $source_value= 1;
406 let $target_value= 1;
407 let $can_convert = $if_is_lossy;
408 source suite/rpl/include/check_type.inc;
409
410 let $source_type= INT;
411 let $target_type= MEDIUMINT;
412 let $source_value= 1;
413 let $target_value= 1;
414 let $can_convert = $if_is_lossy;
415 source suite/rpl/include/check_type.inc;
416
417 let $source_type= INT;
418 let $target_type= INT;
419 let $source_value= 1;
420 let $target_value= 1;
421 let $can_convert = 1;
422 source suite/rpl/include/check_type.inc;
423
424 let $source_type= INT;
425 let $target_type= BIGINT;
426 let $source_value= 1;
427 let $target_value= 1;
428 let $can_convert = $if_is_non_lossy;
429 source suite/rpl/include/check_type.inc;
430
431 let $source_type= BIGINT;
432 let $target_type= TINYINT;
433 let $source_value= 1;
434 let $target_value= 1;
435 let $can_convert = $if_is_lossy;
436 source suite/rpl/include/check_type.inc;
437
438 let $source_type= BIGINT;
439 let $target_type= SMALLINT;
440 let $source_value= 1;
441 let $target_value= 1;
442 let $can_convert = $if_is_lossy;
443 source suite/rpl/include/check_type.inc;
444
445 let $source_type= BIGINT;
446 let $target_type= MEDIUMINT;
447 let $source_value= 1;
448 let $target_value= 1;
449 let $can_convert = $if_is_lossy;
450 source suite/rpl/include/check_type.inc;
451
452 let $source_type= BIGINT;
453 let $target_type= INT;
454 let $source_value= 1;
455 let $target_value= 1;
456 let $can_convert = $if_is_lossy;
457 source suite/rpl/include/check_type.inc;
458
459 let $source_type= BIGINT;
460 let $target_type= BIGINT;
461 let $source_value= 1;
462 let $target_value= 1;
463 let $can_convert = 1;
464 source suite/rpl/include/check_type.inc;
465
466 let $source_type= CHAR(20);
467 let $target_type= CHAR(20);
468 let $source_value= 'Smoothnoodlemaps';
469 let $target_value= 'Smoothnoodlemaps';
470 let $can_convert = 1;
471 source suite/rpl/include/check_type.inc;
472
473 let $source_type= CHAR(20);
474 let $target_type= CHAR(30);
475 let $source_value= 'Smoothnoodlemaps';
476 let $target_value= 'Smoothnoodlemaps';
477 let $can_convert = $if_is_non_lossy;
478 source suite/rpl/include/check_type.inc;
479
480 let $source_type= CHAR(20);
481 let $target_type= CHAR(10);
482 let $source_value= 'Smoothnoodlemaps';
483 let $target_value= 'Smoothnood';
484 let $can_convert = $if_is_lossy;
485 source suite/rpl/include/check_type.inc;
486
487 let $source_type= CHAR(20);
488 let $target_type= VARCHAR(20);
489 let $source_value= 'Smoothnoodlemaps';
490 let $target_value= 'Smoothnoodlemaps';
491 let $can_convert = $if_is_non_lossy;
492 source suite/rpl/include/check_type.inc;
493
494 let $source_type= CHAR(20);
495 let $target_type= VARCHAR(30);
496 let $source_value= 'Smoothnoodlemaps';
497 let $target_value= 'Smoothnoodlemaps';
498 let $can_convert = $if_is_non_lossy;
499 source suite/rpl/include/check_type.inc;
500
501 let $source_type= CHAR(20);
502 let $target_type= VARCHAR(10);
503 let $source_value= 'Smoothnoodlemaps';
504 let $target_value= 'Smoothnood';
505 let $can_convert = $if_is_lossy;
506 source suite/rpl/include/check_type.inc;
507
508 let $source_type= CHAR(20);
509 let $target_type= TINYTEXT;
510 let $source_value= 'Smoothnoodlemaps';
511 let $target_value= 'Smoothnoodlemaps';
512 let $can_convert = $if_is_non_lossy;
513 source suite/rpl/include/check_type.inc;
514
515 let $source_type= CHAR(20);
516 let $target_type= TEXT;
517 let $source_value= 'Smoothnoodlemaps';
518 let $target_value= 'Smoothnoodlemaps';
519 let $can_convert = $if_is_non_lossy;
520 source suite/rpl/include/check_type.inc;
521
522 let $source_type= CHAR(20);
523 let $target_type= MEDIUMTEXT;
524 let $source_value= 'Smoothnoodlemaps';
525 let $target_value= 'Smoothnoodlemaps';
526 let $can_convert = $if_is_non_lossy;
527 source suite/rpl/include/check_type.inc;
528
529 let $source_type= CHAR(20);
530 let $target_type= LONGTEXT;
531 let $source_value= 'Smoothnoodlemaps';
532 let $target_value= 'Smoothnoodlemaps';
533 let $can_convert = $if_is_non_lossy;
534 source suite/rpl/include/check_type.inc;
535
536 let $source_type= VARCHAR(20);
537 let $target_type= VARCHAR(20);
538 let $source_value= 'Smoothnoodlemaps';
539 let $target_value= 'Smoothnoodlemaps';
540 let $can_convert = 1;
541 source suite/rpl/include/check_type.inc;
542
543 let $source_type= VARCHAR(20);
544 let $target_type= VARCHAR(30);
545 let $source_value= 'Smoothnoodlemaps';
546 let $target_value= 'Smoothnoodlemaps';
547 let $can_convert = $if_is_non_lossy;
548 source suite/rpl/include/check_type.inc;
549
550 let $source_type= VARCHAR(20);
551 let $target_type= VARCHAR(10);
552 let $source_value= 'Smoothnoodlemaps';
553 let $target_value= 'Smoothnood';
554 let $can_convert = $if_is_lossy;
555 source suite/rpl/include/check_type.inc;
556
557 let $source_type= VARCHAR(20);
558 let $target_type= CHAR(30);
559 let $source_value= 'Smoothnoodlemaps';
560 let $target_value= 'Smoothnoodlemaps';
561 let $can_convert = $if_is_non_lossy;
562 source suite/rpl/include/check_type.inc;
563
564 let $source_type= VARCHAR(20);
565 let $target_type= CHAR(10);
566 let $source_value= 'Smoothnoodlemaps';
567 let $target_value= 'Smoothnood';
568 let $can_convert = $if_is_lossy;
569 source suite/rpl/include/check_type.inc;
570
571 let $source_type= VARCHAR(20);
572 let $target_type= TINYTEXT;
573 let $source_value= 'Smoothnoodlemaps';
574 let $target_value= 'Smoothnoodlemaps';
575 let $can_convert = $if_is_non_lossy;
576 source suite/rpl/include/check_type.inc;
577
578 let $source_type= VARCHAR(20);
579 let $target_type= TEXT;
580 let $source_value= 'Smoothnoodlemaps';
581 let $target_value= 'Smoothnoodlemaps';
582 let $can_convert = $if_is_non_lossy;
583 source suite/rpl/include/check_type.inc;
584
585 let $source_type= VARCHAR(20);
586 let $target_type= MEDIUMTEXT;
587 let $source_value= 'Smoothnoodlemaps';
588 let $target_value= 'Smoothnoodlemaps';
589 let $can_convert = $if_is_non_lossy;
590 source suite/rpl/include/check_type.inc;
591
592 let $source_type= VARCHAR(20);
593 let $target_type= LONGTEXT;
594 let $source_value= 'Smoothnoodlemaps';
595 let $target_value= 'Smoothnoodlemaps';
596 let $can_convert = $if_is_non_lossy;
597 source suite/rpl/include/check_type.inc;
598
599 let $blob = `select repeat('abcd', 125)`;
600 let $truncated_blob = `select left('$blob', 255)`;
601
602 let $source_type= VARCHAR(500);
603 let $target_type= VARCHAR(500);
604 let $source_value= '$blob';
605 let $target_value= '$blob';
606 let $can_convert = 1;
607 source suite/rpl/include/check_type.inc;
608
609 let $source_type= VARCHAR(500);
610 let $target_type= VARCHAR(510);
611 let $source_value= '$blob';
612 let $target_value= '$blob';
613 let $can_convert = $if_is_non_lossy;
614 source suite/rpl/include/check_type.inc;
615
616 let $source_type= VARCHAR(500);
617 let $target_type= VARCHAR(255);
618 let $source_value= '$blob';
619 let $target_value= '$truncated_blob';
620 let $can_convert = $if_is_lossy;
621 source suite/rpl/include/check_type.inc;
622
623 let $source_type= VARCHAR(500);
624 let $target_type= TINYTEXT;
625 let $source_value= '$blob';
626 let $target_value= '$truncated_blob';
627 let $can_convert = $if_is_lossy;
628 source suite/rpl/include/check_type.inc;
629
630 let $source_type= VARCHAR(500);
631 let $target_type= TEXT;
632 let $source_value= '$blob';
633 let $target_value= '$blob';
634 let $can_convert = $if_is_non_lossy;
635 source suite/rpl/include/check_type.inc;
636
637 let $source_type= VARCHAR(500);
638 let $target_type= MEDIUMTEXT;
639 let $source_value= '$blob';
640 let $target_value= '$blob';
641 let $can_convert = $if_is_non_lossy;
642 source suite/rpl/include/check_type.inc;
643
644 let $source_type= VARCHAR(500);
645 let $target_type= LONGTEXT;
646 let $source_value= '$blob';
647 let $target_value= '$blob';
648 let $can_convert = $if_is_non_lossy;
649 source suite/rpl/include/check_type.inc;
650
651 let $tiny_blob = `select repeat('tiny blob ', 25)`;
652 let $truncated_tiny_blob = `select left('$tiny_blob', 254)`;
653
654 let $source_type= TINYTEXT;
655 let $target_type= VARCHAR(500);
656 let $source_value= '$tiny_blob';
657 let $target_value= '$tiny_blob';
658 let $can_convert = $if_is_non_lossy;
659 source suite/rpl/include/check_type.inc;
660
661 let $source_type= TEXT;
662 let $target_type= VARCHAR(500);
663 let $source_value= '$blob';
664 let $target_value= '$blob';
665 let $can_convert = $if_is_lossy;
666 source suite/rpl/include/check_type.inc;
667
668 let $source_type= MEDIUMTEXT;
669 let $target_type= VARCHAR(500);
670 let $source_value= '$blob';
671 let $target_value= '$blob';
672 let $can_convert = $if_is_lossy;
673 source suite/rpl/include/check_type.inc;
674
675 let $source_type= LONGTEXT;
676 let $target_type= VARCHAR(500);
677 let $source_value= '$blob';
678 let $target_value= '$blob';
679 let $can_convert = $if_is_lossy;
680 source suite/rpl/include/check_type.inc;
681
682 let $source_type= TINYTEXT;
683 let $target_type= CHAR(255);
684 let $source_value= '$tiny_blob';
685 let $target_value= '$tiny_blob';
686 let $can_convert = $if_is_non_lossy;
687 source suite/rpl/include/check_type.inc;
688
689 let $source_type= TINYTEXT;
690 let $target_type= CHAR(250);
691 let $source_value= '$tiny_blob';
692 let $target_value= left('$tiny_blob', 250);
693 let $can_convert = $if_is_lossy;
694 source suite/rpl/include/check_type.inc;
695
696 let $source_type= TEXT;
697 let $target_type= CHAR(255);
698 let $source_value= '$blob';
699 let $target_value= left('$blob', 255);
700 let $can_convert = $if_is_lossy;
701 source suite/rpl/include/check_type.inc;
702
703 let $source_type= MEDIUMTEXT;
704 let $target_type= CHAR(255);
705 let $source_value= '$blob';
706 let $target_value= left('$blob', 255);
707 let $can_convert = $if_is_lossy;
708 source suite/rpl/include/check_type.inc;
709
710 let $source_type= LONGTEXT;
711 let $target_type= CHAR(255);
712 let $source_value= '$blob';
713 let $target_value= left('$blob', 255);
714 let $can_convert = $if_is_lossy;
715 source suite/rpl/include/check_type.inc;
716
717 let $source_type= TINYTEXT;
718 let $target_type= TINYTEXT;
719 let $source_value= '$tiny_blob';
720 let $target_value= '$tiny_blob';
721 let $can_convert = 1;
722 source suite/rpl/include/check_type.inc;
723
724 let $source_type= TINYTEXT;
725 let $target_type= TEXT;
726 let $source_value= '$tiny_blob';
727 let $target_value= '$tiny_blob';
728 let $can_convert = $if_is_non_lossy;
729 source suite/rpl/include/check_type.inc;
730
731 let $source_type= TEXT;
732 let $target_type= TINYTEXT;
733 let $source_value= '$blob';
734 let $target_value= left('$blob',255);
735 let $can_convert = $if_is_lossy;
736 source suite/rpl/include/check_type.inc;
737
738 let $source_type= DECIMAL(10,5);
739 let $target_type= DECIMAL(10,5);
740 let $source_value= 3.14159;
741 let $target_value= 3.14159;
742 let $can_convert = 1;
743 source suite/rpl/include/check_type.inc;
744
745 let $source_type= DECIMAL(10,5);
746 let $target_type= DECIMAL(10,6);
747 let $source_value= 3.14159;
748 let $target_value= 3.141590;
749 let $can_convert = $if_is_non_lossy;
750 source suite/rpl/include/check_type.inc;
751
752 let $source_type= DECIMAL(10,5);
753 let $target_type= DECIMAL(11,5);
754 let $source_value= 3.14159;
755 let $target_value= 3.14159;
756 let $can_convert = $if_is_non_lossy;
757 source suite/rpl/include/check_type.inc;
758
759 let $source_type= DECIMAL(10,5);
760 let $target_type= DECIMAL(11,6);
761 let $source_value= 3.14159;
762 let $target_value= 3.141590;
763 let $can_convert = $if_is_non_lossy;
764 source suite/rpl/include/check_type.inc;
765
766 let $source_type= DECIMAL(10,5);
767 let $target_type= DECIMAL(10,4);
768 let $source_value= 3.14159;
769 let $target_value= 3.1416;
770 let $can_convert = $if_is_lossy;
771 source suite/rpl/include/check_type.inc;
772
773 let $source_type= DECIMAL(10,5);
774 let $target_type= DECIMAL(9,5);
775 let $source_value= 3.14159;
776 let $target_value= 3.14159;
777 let $can_convert = $if_is_lossy;
778 source suite/rpl/include/check_type.inc;
779
780 let $source_type= DECIMAL(10,5);
781 let $target_type= DECIMAL(9,4);
782 let $source_value= 3.14159;
783 let $target_value= 3.1416;
784 let $can_convert = $if_is_lossy;
785 source suite/rpl/include/check_type.inc;
786
787 let $source_type= FLOAT;
788 let $target_type= DECIMAL(10,5);
789 let $source_value= 3.15625;
790 let $target_value= 3.15625;
791 let $can_convert = $if_is_lossy;
792 source suite/rpl/include/check_type.inc;
793
794 let $source_type= DOUBLE;
795 let $target_type= DECIMAL(10,5);
796 let $source_value= 3.15625;
797 let $target_value= 3.15625;
798 let $can_convert = $if_is_lossy;
799 source suite/rpl/include/check_type.inc;
800
801 let $source_type= DECIMAL(10,5);
802 let $target_type= FLOAT;
803 let $source_value= 3.15625;
804 let $target_value= 3.15625;
805 let $can_convert = $if_is_lossy;
806 source suite/rpl/include/check_type.inc;
807
808 let $source_type= DECIMAL(10,5);
809 let $target_type= DOUBLE;
810 let $source_value= 3.15625;
811 let $target_value= 3.15625;
812 let $can_convert = $if_is_lossy;
813 source suite/rpl/include/check_type.inc;
814
815 let $source_type= FLOAT;
816 let $target_type= FLOAT;
817 let $source_value= 3.15625;
818 let $target_value= 3.15625;
819 let $can_convert = 1;
820 source suite/rpl/include/check_type.inc;
821
822 let $source_type= DOUBLE;
823 let $target_type= DOUBLE;
824 let $source_value= 3.15625;
825 let $target_value= 3.15625;
826 let $can_convert = 1;
827 source suite/rpl/include/check_type.inc;
828
829 let $source_type= FLOAT;
830 let $target_type= DOUBLE;
831 let $source_value= 3.15625;
832 let $target_value= 3.15625;
833 let $can_convert = $if_is_non_lossy;
834 source suite/rpl/include/check_type.inc;
835
836 let $source_type= DOUBLE;
837 let $target_type= FLOAT;
838 let $source_value= 3.15625;
839 let $target_value= 3.15625;
840 let $can_convert = $if_is_lossy;
841 source suite/rpl/include/check_type.inc;
842
843 let $source_type= BIT(5);
844 let $target_type= BIT(5);
845 let $source_value= b'11001';
846 let $target_value= b'11001';
847 let $can_convert = 1;
848 source suite/rpl/include/check_type.inc;
849
850 let $source_type= BIT(5);
851 let $target_type= BIT(6);
852 let $source_value= b'11001';
853 let $target_value= b'11001';
854 let $can_convert = $if_is_non_lossy;
855 source suite/rpl/include/check_type.inc;
856
857 let $source_type= BIT(6);
858 let $target_type= BIT(5);
859 let $source_value= b'111001';
860 let $target_value= b'11111';
861 let $can_convert = $if_is_lossy;
862 source suite/rpl/include/check_type.inc;
863
864 let $source_type= BIT(5);
865 let $target_type= BIT(12);
866 let $source_value= b'11001';
867 let $target_value= b'11001';
868 let $can_convert = $if_is_non_lossy;
869 source suite/rpl/include/check_type.inc;
870
871 let $source_type= BIT(12);
872 let $target_type= BIT(5);
873 let $source_value= b'101100111000';
874 let $target_value= b'11111';
875 let $can_convert = $if_is_lossy;
876 source suite/rpl/include/check_type.inc;
877
878
879 --echo #
880 --echo # MDEV-15821 Row format replication from LONGBLOB COMPRESSED to LONGBLOB does not work
881 --echo #
882
883 # This is to make sure that the compressed data is longer than 64K
884 SET column_compression_threshold=16*256*256;
885
886 # TINYBLOB COMPRESSED
887
888 let $source_type= TINYBLOB COMPRESSED;
889 let $target_type= TINYBLOB;
890 let $source_value= REPEAT('a',250);
891 let $target_value= REPEAT('a',250);
892 let $can_convert = $if_is_non_lossy;
893 source suite/rpl/include/check_type.inc;
894
895 let $source_type= TINYBLOB COMPRESSED;
896 let $target_type= BLOB;
897 let $source_value= REPEAT('a',250);
898 let $target_value= REPEAT('a',250);
899 let $can_convert = $if_is_non_lossy;
900 source suite/rpl/include/check_type.inc;
901
902 let $source_type= TINYBLOB COMPRESSED;
903 let $target_type= MEDIUMBLOB;
904 let $source_value= REPEAT('a',250);
905 let $target_value= REPEAT('a',250);
906 let $can_convert = $if_is_non_lossy;
907 source suite/rpl/include/check_type.inc;
908
909 let $source_type= TINYBLOB COMPRESSED;
910 let $target_type= LONGBLOB;
911 let $source_value= REPEAT('a',250);
912 let $target_value= REPEAT('a',250);
913 let $can_convert = $if_is_non_lossy;
914 source suite/rpl/include/check_type.inc;
915
916 let $source_type= TINYBLOB COMPRESSED;
917 let $target_type= VARBINARY(255);
918 let $source_value= REPEAT('a',250);
919 let $target_value= REPEAT('a',250);
920 let $can_convert = $if_is_non_lossy;
921 source suite/rpl/include/check_type.inc;
922
923
924 # BLOB COMPRESSED
925
926 let $source_type= BLOB COMPRESSED;
927 let $target_type= TINYBLOB;
928 let $source_value= REPEAT('a',64000);
929 let $target_value= REPEAT('a',255);
930 let $can_convert = $if_is_lossy;
931 source suite/rpl/include/check_type.inc;
932
933 let $source_type= BLOB COMPRESSED;
934 let $target_type= BLOB;
935 let $source_value= REPEAT('a',64000);
936 let $target_value= REPEAT('a',64000);
937 let $can_convert = $if_is_non_lossy;
938 source suite/rpl/include/check_type.inc;
939
940 let $source_type= BLOB COMPRESSED;
941 let $target_type= MEDIUMBLOB;
942 let $source_value= REPEAT('a',64000);
943 let $target_value= REPEAT('a',64000);
944 let $can_convert = $if_is_non_lossy;
945 source suite/rpl/include/check_type.inc;
946
947 let $source_type= BLOB COMPRESSED;
948 let $target_type= LONGBLOB;
949 let $source_value= REPEAT('a',64000);
950 let $target_value= REPEAT('a',64000);
951 let $can_convert = $if_is_non_lossy;
952 source suite/rpl/include/check_type.inc;
953
954 let $source_type= BLOB COMPRESSED;
955 let $target_type= VARBINARY(65500);
956 let $source_value= REPEAT('a',65500);
957 let $target_value= REPEAT('a',65500);
958 let $can_convert = $if_is_lossy;
959 source suite/rpl/include/check_type.inc;
960
961
962 # MEDIUMBLOB COMPRESSED
963
964 let $source_type= MEDIUMBLOB COMPRESSED;
965 let $target_type= TINYBLOB;
966 let $source_value= REPEAT('a',66000);
967 let $target_value= REPEAT('a',255);
968 let $can_convert = $if_is_lossy;
969 source suite/rpl/include/check_type.inc;
970
971 # This failed before the fix
972 let $source_type= MEDIUMBLOB COMPRESSED;
973 let $target_type= BLOB;
974 let $source_value= REPEAT('a',66000);
975 let $target_value= REPEAT('a',65535);
976 let $can_convert = $if_is_lossy;
977 source suite/rpl/include/check_type.inc;
978
979 # This failed before the fix
980 let $source_type= MEDIUMBLOB COMPRESSED;
981 let $target_type= MEDIUMBLOB;
982 let $source_value= REPEAT('a',66000);
983 let $target_value= REPEAT('a',66000);
984 let $can_convert = $if_is_non_lossy;
985 source suite/rpl/include/check_type.inc;
986
987 # This failed before the fix
988 let $source_type= MEDIUMBLOB COMPRESSED;
989 let $target_type= LONGBLOB;
990 let $source_value= REPEAT('a',66000);
991 let $target_value= REPEAT('a',66000);
992 let $can_convert = $if_is_non_lossy;
993 source suite/rpl/include/check_type.inc;
994
995 # This failed before the fix
996 let $source_type= MEDIUMBLOB COMPRESSED;
997 let $target_type= VARBINARY(65500);
998 let $source_value= REPEAT('a',66000);
999 let $target_value= REPEAT('a',65500);
1000 let $can_convert = $if_is_lossy;
1001 source suite/rpl/include/check_type.inc;
1002
1003
1004 # LONGBLOB COMPRESSED
1005
1006 let $source_type= LONGBLOB COMPRESSED;
1007 let $target_type= TINYBLOB;
1008 let $source_value= REPEAT('a',66000);
1009 let $target_value= REPEAT('a',255);
1010 let $can_convert = $if_is_lossy;
1011 source suite/rpl/include/check_type.inc;
1012
1013 # This failed before the fix
1014 let $source_type= LONGBLOB COMPRESSED;
1015 let $target_type= BLOB;
1016 let $source_value= REPEAT('a',66000);
1017 let $target_value= REPEAT('a',65535);
1018 let $can_convert = $if_is_lossy;
1019 source suite/rpl/include/check_type.inc;
1020
1021 # This failed before the fix
1022 let $source_type= LONGBLOB COMPRESSED;
1023 let $target_type= MEDIUMBLOB;
1024 let $source_value= REPEAT('a',66000);
1025 let $target_value= REPEAT('a',66000);
1026 let $can_convert = $if_is_lossy;
1027 source suite/rpl/include/check_type.inc;
1028
1029 # This failed before the fix
1030 let $source_type= LONGBLOB COMPRESSED;
1031 let $target_type= LONGBLOB;
1032 let $source_value= REPEAT('a',66000);
1033 let $target_value= REPEAT('a',66000);
1034 let $can_convert = $if_is_non_lossy;
1035 source suite/rpl/include/check_type.inc;
1036
1037 # This failed before the fix
1038 let $source_type= LONGBLOB COMPRESSED;
1039 let $target_type= VARBINARY(65500);
1040 let $source_value= REPEAT('a',66000);
1041 let $target_value= REPEAT('a',65500);
1042 let $can_convert = $if_is_lossy;
1043 source suite/rpl/include/check_type.inc;
1044
1045 SET column_compression_threshold=DEFAULT;
1046 --echo # End of MDEV-15821
1047
1048
1049 --echo #
1050 --echo # MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
1051 --echo #
1052
1053 # TINYBLOB
1054
1055 let $source_type= TINYBLOB;
1056 let $target_type= BLOB;
1057 let $source_value= REPEAT('a',250);
1058 let $target_value= REPEAT('a',250);
1059 let $can_convert = $if_is_non_lossy;
1060 source suite/rpl/include/check_type.inc;
1061
1062 let $source_type= TINYBLOB;
1063 let $target_type= MEDIUMBLOB;
1064 let $source_value= REPEAT('a',250);
1065 let $target_value= REPEAT('a',250);
1066 let $can_convert = $if_is_non_lossy;
1067 source suite/rpl/include/check_type.inc;
1068
1069 let $source_type= TINYBLOB;
1070 let $target_type= LONGBLOB;
1071 let $source_value= REPEAT('a',250);
1072 let $target_value= REPEAT('a',250);
1073 let $can_convert = $if_is_non_lossy;
1074 source suite/rpl/include/check_type.inc;
1075
1076 let $source_type= TINYBLOB;
1077 let $target_type= VARBINARY(255);
1078 let $source_value= REPEAT('a',250);
1079 let $target_value= REPEAT('a',250);
1080 let $can_convert = $if_is_non_lossy;
1081 source suite/rpl/include/check_type.inc;
1082
1083
1084 # BLOB
1085
1086 let $source_type= BLOB;
1087 let $target_type= TINYBLOB;
1088 let $source_value= REPEAT('a',64000);
1089 let $target_value= REPEAT('a',255);
1090 let $can_convert = $if_is_lossy;
1091 source suite/rpl/include/check_type.inc;
1092
1093 let $source_type= BLOB;
1094 let $target_type= MEDIUMBLOB;
1095 let $source_value= REPEAT('a',64000);
1096 let $target_value= REPEAT('a',64000);
1097 let $can_convert = $if_is_non_lossy;
1098 source suite/rpl/include/check_type.inc;
1099
1100 let $source_type= BLOB;
1101 let $target_type= LONGBLOB;
1102 let $source_value= REPEAT('a',64000);
1103 let $target_value= REPEAT('a',64000);
1104 let $can_convert = $if_is_non_lossy;
1105 source suite/rpl/include/check_type.inc;
1106
1107 let $source_type= BLOB;
1108 let $target_type= VARBINARY(65500);
1109 let $source_value= REPEAT('a',65535);
1110 let $target_value= REPEAT('a',65500);
1111 let $can_convert = $if_is_lossy;
1112 source suite/rpl/include/check_type.inc;
1113
1114
1115 # MEDIUMBLOB
1116
1117 let $source_type= MEDIUMBLOB;
1118 let $target_type= TINYBLOB;
1119 let $source_value= REPEAT('a',66000);
1120 let $target_value= REPEAT('a',255);
1121 let $can_convert = $if_is_lossy;
1122 source suite/rpl/include/check_type.inc;
1123
1124 let $source_type= MEDIUMBLOB;
1125 let $target_type= BLOB;
1126 let $source_value= REPEAT('a',66000);
1127 let $target_value= REPEAT('a',65535);
1128 let $can_convert = $if_is_lossy;
1129 source suite/rpl/include/check_type.inc;
1130
1131 # This failed before the fix
1132 let $source_type= MEDIUMBLOB;
1133 let $target_type= LONGBLOB;
1134 let $source_value= REPEAT('a',66000);
1135 let $target_value= REPEAT('a',66000);
1136 let $can_convert = $if_is_non_lossy;
1137 source suite/rpl/include/check_type.inc;
1138
1139 let $source_type= MEDIUMBLOB;
1140 let $target_type= VARBINARY(65500);
1141 let $source_value= REPEAT('a',66000);
1142 let $target_value= REPEAT('a',65500);
1143 let $can_convert = $if_is_lossy;
1144 source suite/rpl/include/check_type.inc;
1145
1146
1147 # LONGBLOB
1148
1149 let $source_type= LONGBLOB;
1150 let $target_type= TINYBLOB;
1151 let $source_value= REPEAT('a',66000);
1152 let $target_value= REPEAT('a',255);
1153 let $can_convert = $if_is_lossy;
1154 source suite/rpl/include/check_type.inc;
1155
1156 let $source_type= LONGBLOB;
1157 let $target_type= BLOB;
1158 let $source_value= REPEAT('a',66000);
1159 let $target_value= REPEAT('a',65535);
1160 let $can_convert = $if_is_lossy;
1161 source suite/rpl/include/check_type.inc;
1162
1163 # This failed before the fix
1164 let $source_type= LONGBLOB;
1165 let $target_type= MEDIUMBLOB;
1166 let $source_value= REPEAT('a',66000);
1167 let $target_value= REPEAT('a',66000);
1168 let $can_convert = $if_is_lossy;
1169 source suite/rpl/include/check_type.inc;
1170
1171 let $source_type= LONGBLOB;
1172 let $target_type= VARBINARY(65500);
1173 let $source_value= REPEAT('a',66000);
1174 let $target_value= REPEAT('a',65500);
1175 let $can_convert = $if_is_lossy;
1176 source suite/rpl/include/check_type.inc;
1177
1178 --echo # End of MDEV-15833
1179
1180 --echo #
1181 --echo # MDEV-17098 DATE <-> DATETIME
1182 --echo #
1183
1184 # NON-LOSSY
1185 let $source_temp_format= 1; # irrelevant with DATE though
1186 let $source_type= DATE;
1187 let $target_temp_format= 1; # to produce MYSQL_TYPE_DATETIME2
1188 let $target_type= DATETIME(6);
1189 let $source_value= '2018-10-11';
1190 let $target_value= '2018-10-11 00:00:00.000000';
1191 let $can_convert = $if_is_non_lossy;
1192 source suite/rpl/include/check_type.inc;
1193
1194 let $source_temp_format= 1;
1195 let $source_type= DATE;
1196 let $target_temp_format= 0; # to produce "old" MYSQL_TYPE_DATETIME
1197 let $target_type= DATETIME(6);
1198 let $source_value= '2018-10-11';
1199 let $target_value= '2018-10-11 00:00:00.000000';
1200 let $can_convert = $if_is_non_lossy;
1201 source suite/rpl/include/check_type.inc;
1202
1203 let $source_temp_format= 0;
1204 let $source_type= DATE;
1205 let $target_temp_format= 1;
1206 let $target_type= DATETIME(6);
1207 let $source_value= '2018-10-11';
1208 let $target_value= '2018-10-11 00:00:00.000000';
1209 let $can_convert = $if_is_non_lossy;
1210 source suite/rpl/include/check_type.inc;
1211
1212 # zero-precision test version
1213 let $source_temp_format= 1;
1214 let $source_type= DATE;
1215 let $target_temp_format= 1;
1216 let $target_type= DATETIME(0);
1217 let $source_value= '2018-10-11';
1218 let $target_value= '2018-10-11 00:00:00';
1219 let $can_convert = $if_is_non_lossy;
1220 source suite/rpl/include/check_type.inc;
1221
1222 # LOSSY
1223 let $source_temp_format= 1;
1224 let $source_type= DATETIME(6);
1225 let $target_temp_format= 1;
1226 let $target_type= DATE;
1227 let $source_value= '2018-10-11 00:00:00.000001';
1228 let $target_value= '2018-10-11';
1229 let $can_convert = $if_is_lossy;
1230 source suite/rpl/include/check_type.inc;
1231
1232 let $source_temp_format= 1;
1233 let $source_type= DATETIME(6);
1234 let $target_temp_format= 0;
1235 let $target_type= DATE;
1236 let $source_value= '2018-10-11 00:00:00.000001';
1237 let $target_value= '2018-10-11';
1238 let $can_convert = $if_is_lossy;
1239 source suite/rpl/include/check_type.inc;
1240
1241 # zero-precision test version
1242 let $source_temp_format= 1;
1243 let $source_type= DATETIME(0);
1244 let $target_temp_format= 1;
1245 let $target_type= DATE;
1246 let $source_value= '2018-10-11 00:00:00';
1247 let $target_value= '2018-10-11';
1248 let $can_convert = $if_is_lossy;
1249 source suite/rpl/include/check_type.inc;
1250
1251 # TODO: fix MDEV-17394 Row-based replication DATETIME(m) to
1252 # DATETIME(s) does not work or incorrect
1253 #
1254 #
1255 # let $source_temp_format= 0;
1256 # let $source_type= DATETIME(6);
1257 # let $target_temp_format= 1;
1258 # let $target_type= DATE;
1259 # ...
1260 # let $source_temp_format= 0;
1261 # let $source_type= DATETIME(6);
1262 # let $target_temp_format= 0;
1263 # let $target_type= DATE;
1264 # ...
1265
1266 let $source_temp_format=;
1267 let $target_temp_format=;
1268 --echo # End of MDEV-17098
1269
1270
1271 --source include/rpl_reset.inc
1272 enable_query_log;