1 #################################################################################
2 # Author: Serge Kozlov #
4 # Purpose: used by ../t/*_charset.test #
5 # Require: set $engine_type= [NDB,MyISAM,InnoDB,etc] before calling #
7 # Last modification: Matthias Leich #
9 # Purpose: Fix Bug#37160 funcs_2: The tests do not check if optional character #
11 # Add checking of prerequisites + minor cleanup #
12 #################################################################################
18 # Check that all character sets needed are available
20 # It is intentional that the common solution with
21 # "--source include/have_<character set>.inc"
23 # - We currently do not have such a prerequisite test for every character set
25 # - There is also no real value in mentioning the first missing character set
26 # /collation within the "skip message" because it is most probably only
29 # Hint: 5 character_set_names per source line if possible
30 if (`SELECT COUNT(*) <> 36 FROM information_schema.character_sets
31 WHERE CHARACTER_SET_NAME IN (
32 'armscii8', 'ascii' , 'big5' , 'binary' , 'cp1250',
33 'cp1251' , 'cp1256' , 'cp1257' , 'cp850' , 'cp852' ,
34 'cp866' , 'cp932' , 'dec8' , 'eucjpms', 'euckr' ,
35 'gb2312' , 'gbk' , 'geostd8', 'greek' , 'hebrew',
36 'hp8' , 'keybcs2', 'koi8r' , 'koi8u' , 'latin1',
37 'latin2' , 'latin5' , 'latin7' , 'macce' , 'macroman',
38 'sjis' , 'swe7' , 'tis620' , 'ucs2' , 'ujis',
42 --skip Not all character sets required for this test are present
44 # Check that all collations needed are available
45 # Hint: 4 collation_names per source line if possible
46 if (`SELECT COUNT(*) <> 123 FROM information_schema.collations
47 WHERE collation_name IN (
48 'armscii8_bin', 'armscii8_general_ci', 'ascii_bin', 'ascii_general_ci',
49 'big5_bin', 'big5_chinese_ci', 'cp1250_bin', 'cp1250_croatian_ci',
50 'cp1250_czech_cs', 'cp1250_general_ci', 'cp1251_bin', 'cp1251_bulgarian_ci',
51 'cp1251_general_ci', 'cp1251_general_cs', 'cp1251_ukrainian_ci', 'cp1256_bin',
52 'cp1256_general_ci', 'cp1257_bin', 'cp1257_general_ci', 'cp1257_lithuanian_ci',
53 'cp850_bin', 'cp850_general_ci', 'cp852_bin', 'cp852_general_ci',
54 'cp866_bin', 'cp866_general_ci', 'cp932_bin', 'cp932_japanese_ci',
55 'dec8_bin', 'dec8_swedish_ci', 'eucjpms_bin', 'eucjpms_japanese_ci',
56 'euckr_bin', 'euckr_korean_ci', 'gb2312_bin', 'gb2312_chinese_ci',
57 'gbk_bin', 'gbk_chinese_ci', 'geostd8_bin', 'geostd8_general_ci',
58 'greek_bin', 'greek_general_ci', 'hebrew_bin', 'hebrew_general_ci',
59 'hp8_bin', 'hp8_english_ci', 'keybcs2_bin', 'keybcs2_general_ci',
60 'koi8r_bin', 'koi8r_general_ci', 'koi8u_bin', 'koi8u_general_ci',
61 'latin1_bin', 'latin1_danish_ci', 'latin1_general_ci', 'latin1_general_cs',
62 'latin1_german1_ci', 'latin1_german2_ci', 'latin1_spanish_ci', 'latin1_swedish_ci',
63 'latin2_bin', 'latin2_croatian_ci', 'latin2_czech_cs', 'latin2_general_ci',
64 'latin2_hungarian_ci', 'latin5_bin', 'latin5_turkish_ci', 'latin7_bin',
65 'latin7_estonian_cs', 'latin7_general_ci', 'latin7_general_cs', 'macce_bin',
66 'macce_general_ci', 'macroman_bin', 'macroman_general_ci', 'sjis_bin',
67 'sjis_japanese_ci', 'swe7_bin', 'swe7_swedish_ci', 'tis620_bin',
68 'tis620_thai_ci', 'ucs2_bin', 'ucs2_czech_ci', 'ucs2_danish_ci',
69 'ucs2_estonian_ci', 'ucs2_general_ci', 'ucs2_hungarian_ci', 'ucs2_icelandic_ci',
70 'ucs2_latvian_ci', 'ucs2_lithuanian_ci', 'ucs2_persian_ci', 'ucs2_polish_ci',
71 'ucs2_roman_ci', 'ucs2_romanian_ci', 'ucs2_slovak_ci', 'ucs2_slovenian_ci',
72 'ucs2_spanish2_ci', 'ucs2_spanish_ci', 'ucs2_swedish_ci', 'ucs2_turkish_ci',
73 'ucs2_unicode_ci', 'ujis_bin', 'ujis_japanese_ci', 'utf8_bin',
74 'utf8_czech_ci', 'utf8_danish_ci', 'utf8_estonian_ci', 'utf8_general_ci',
75 'utf8_hungarian_ci', 'utf8_icelandic_ci', 'utf8_latvian_ci', 'utf8_lithuanian_ci',
76 'utf8_persian_ci', 'utf8_polish_ci', 'utf8_roman_ci', 'utf8_romanian_ci',
77 'utf8_slovak_ci', 'utf8_slovenian_ci', 'utf8_spanish2_ci', 'utf8_spanish_ci',
78 'utf8_swedish_ci', 'utf8_turkish_ci', 'utf8_unicode_ci'
81 --skip Not all collations required for this test are present
84 ################################
85 let $check_std_csets= 1;
86 let $check_ucs2_csets= 1;
87 let $check_utf8_csets= 1;
89 # Bug#32784: Timeout in test "innodb_charset": InnoDB much slower
91 # NOTE: We turn autocommit off to improve the performance of the innodb variant
92 # of this test. Per Innobase's recommendation.
99 # Check all charsets/collation combinations
102 ################################
103 let $check_std_csets= 1;
104 let $check_ucs2_csets= 1;
105 let $check_utf8_csets= 1;
108 # Check all charsets/collation combinations
111 if ($check_std_csets)
117 let $coll= armscii8_bin;
118 --source suite/funcs_2/include/check_charset.inc
121 let $coll= armscii8_general_ci;
122 --source suite/funcs_2/include/check_charset.inc
127 let $coll= ascii_bin;
128 --source suite/funcs_2/include/check_charset.inc
131 let $coll= ascii_general_ci;
132 --source suite/funcs_2/include/check_charset.inc
138 --source suite/funcs_2/include/check_charset.inc
141 let $coll= big5_chinese_ci;
142 --source suite/funcs_2/include/check_charset.inc
149 --source suite/funcs_2/include/check_charset.inc
154 let $coll= cp1250_bin;
155 --source suite/funcs_2/include/check_charset.inc
158 let $coll= cp1250_croatian_ci;
159 --source suite/funcs_2/include/check_charset.inc
163 let $coll= cp1250_czech_cs;
164 --source suite/funcs_2/include/check_charset.inc
168 let $coll= cp1250_general_ci;
169 --source suite/funcs_2/include/check_charset.inc
174 let $coll= cp1251_bin;
175 --source suite/funcs_2/include/check_charset.inc
178 let $coll= cp1251_bulgarian_ci;
179 --source suite/funcs_2/include/check_charset.inc
182 let $coll= cp1251_general_ci;
183 --source suite/funcs_2/include/check_charset.inc
186 let $coll= cp1251_general_cs;
187 --source suite/funcs_2/include/check_charset.inc
190 let $coll= cp1251_ukrainian_ci;
191 --source suite/funcs_2/include/check_charset.inc
196 let $coll= cp1256_bin;
197 --source suite/funcs_2/include/check_charset.inc
200 let $coll= cp1256_general_ci;
201 --source suite/funcs_2/include/check_charset.inc
206 let $coll= cp1257_bin;
207 --source suite/funcs_2/include/check_charset.inc
210 let $coll= cp1257_general_ci;
211 --source suite/funcs_2/include/check_charset.inc
214 let $coll= cp1257_lithuanian_ci;
215 --source suite/funcs_2/include/check_charset.inc
220 let $coll= cp850_bin;
221 --source suite/funcs_2/include/check_charset.inc
224 let $coll= cp850_general_ci;
225 --source suite/funcs_2/include/check_charset.inc
230 let $coll= cp852_bin;
231 --source suite/funcs_2/include/check_charset.inc
234 let $coll= cp852_general_ci;
235 --source suite/funcs_2/include/check_charset.inc
240 let $coll= cp866_bin;
241 --source suite/funcs_2/include/check_charset.inc
244 let $coll= cp866_general_ci;
245 --source suite/funcs_2/include/check_charset.inc
250 let $coll= cp932_bin;
251 --source suite/funcs_2/include/check_charset.inc
254 let $coll= cp932_japanese_ci;
255 --source suite/funcs_2/include/check_charset.inc
261 --source suite/funcs_2/include/check_charset.inc
264 let $coll= dec8_swedish_ci;
265 --source suite/funcs_2/include/check_charset.inc
270 let $coll= eucjpms_bin;
271 --source suite/funcs_2/include/check_charset.inc
274 let $coll= eucjpms_japanese_ci;
275 --source suite/funcs_2/include/check_charset.inc
280 let $coll= euckr_bin;
281 --source suite/funcs_2/include/check_charset.inc
284 let $coll= euckr_korean_ci;
285 --source suite/funcs_2/include/check_charset.inc
290 let $coll= gb2312_bin;
291 --source suite/funcs_2/include/check_charset.inc
294 let $coll= gb2312_chinese_ci;
295 --source suite/funcs_2/include/check_charset.inc
301 --source suite/funcs_2/include/check_charset.inc
304 let $coll= gbk_chinese_ci;
305 --source suite/funcs_2/include/check_charset.inc
310 let $coll= geostd8_bin;
311 --source suite/funcs_2/include/check_charset.inc
314 let $coll= geostd8_general_ci;
315 --source suite/funcs_2/include/check_charset.inc
320 let $coll= greek_bin;
321 --source suite/funcs_2/include/check_charset.inc
324 let $coll= greek_general_ci;
325 --source suite/funcs_2/include/check_charset.inc
330 let $coll= hebrew_bin;
331 --source suite/funcs_2/include/check_charset.inc
334 let $coll= hebrew_general_ci;
335 --source suite/funcs_2/include/check_charset.inc
341 --source suite/funcs_2/include/check_charset.inc
344 let $coll= hp8_english_ci;
345 --source suite/funcs_2/include/check_charset.inc
350 let $coll= keybcs2_bin;
351 --source suite/funcs_2/include/check_charset.inc
354 let $coll= keybcs2_general_ci;
355 --source suite/funcs_2/include/check_charset.inc
360 let $coll= koi8r_bin;
361 --source suite/funcs_2/include/check_charset.inc
364 let $coll= koi8r_general_ci;
365 --source suite/funcs_2/include/check_charset.inc
370 let $coll= koi8u_bin;
371 --source suite/funcs_2/include/check_charset.inc
374 let $coll= koi8u_general_ci;
375 --source suite/funcs_2/include/check_charset.inc
380 let $coll= latin1_bin;
381 --source suite/funcs_2/include/check_charset.inc
384 let $coll= latin1_danish_ci;
385 --source suite/funcs_2/include/check_charset.inc
388 let $coll= latin1_general_ci;
389 --source suite/funcs_2/include/check_charset.inc
392 let $coll= latin1_general_cs;
393 --source suite/funcs_2/include/check_charset.inc
397 let $coll= latin1_german1_ci;
398 --source suite/funcs_2/include/check_charset.inc
401 let $coll= latin1_german2_ci;
402 --source suite/funcs_2/include/check_charset.inc
405 let $coll= latin1_spanish_ci;
406 --source suite/funcs_2/include/check_charset.inc
409 let $coll= latin1_swedish_ci;
410 --source suite/funcs_2/include/check_charset.inc
415 let $coll= latin2_bin;
416 --source suite/funcs_2/include/check_charset.inc
419 let $coll= latin2_croatian_ci;
420 --source suite/funcs_2/include/check_charset.inc
423 let $coll= latin2_czech_cs;
424 --source suite/funcs_2/include/check_charset.inc
427 let $coll= latin2_general_ci;
428 --source suite/funcs_2/include/check_charset.inc
431 let $coll= latin2_hungarian_ci;
432 --source suite/funcs_2/include/check_charset.inc
437 let $coll= latin5_bin;
438 --source suite/funcs_2/include/check_charset.inc
441 let $coll= latin5_turkish_ci;
442 --source suite/funcs_2/include/check_charset.inc
447 let $coll= latin7_bin;
448 --source suite/funcs_2/include/check_charset.inc
451 let $coll= latin7_estonian_cs;
452 --source suite/funcs_2/include/check_charset.inc
455 let $coll= latin7_general_ci;
456 --source suite/funcs_2/include/check_charset.inc
459 let $coll= latin7_general_cs;
460 --source suite/funcs_2/include/check_charset.inc
465 let $coll= macce_bin;
466 --source suite/funcs_2/include/check_charset.inc
469 let $coll= macce_general_ci;
470 --source suite/funcs_2/include/check_charset.inc
475 let $coll= macroman_bin;
476 --source suite/funcs_2/include/check_charset.inc
479 let $coll= macroman_general_ci;
480 --source suite/funcs_2/include/check_charset.inc
486 --source suite/funcs_2/include/check_charset.inc
489 let $coll= sjis_japanese_ci;
490 --source suite/funcs_2/include/check_charset.inc
496 --source suite/funcs_2/include/check_charset.inc
499 let $coll= swe7_swedish_ci;
500 --source suite/funcs_2/include/check_charset.inc
505 let $coll= tis620_bin;
506 --source suite/funcs_2/include/check_charset.inc
509 let $coll= tis620_thai_ci;
510 --source suite/funcs_2/include/check_charset.inc
516 --source suite/funcs_2/include/check_charset.inc
519 let $coll= ujis_japanese_ci;
520 --source suite/funcs_2/include/check_charset.inc
524 if ($check_ucs2_csets)
531 --source suite/funcs_2/include/check_charset_ucs2.inc
534 let $coll= ucs2_czech_ci;
535 --source suite/funcs_2/include/check_charset_ucs2.inc
538 let $coll= ucs2_danish_ci;
539 --source suite/funcs_2/include/check_charset_ucs2.inc
542 let $coll= ucs2_estonian_ci;
543 --source suite/funcs_2/include/check_charset_ucs2.inc
546 let $coll= ucs2_general_ci;
547 --source suite/funcs_2/include/check_charset_ucs2.inc
550 let $coll= ucs2_hungarian_ci;
551 --source suite/funcs_2/include/check_charset_ucs2.inc
554 let $coll= ucs2_icelandic_ci;
555 --source suite/funcs_2/include/check_charset_ucs2.inc
558 let $coll= ucs2_latvian_ci;
559 --source suite/funcs_2/include/check_charset_ucs2.inc
562 let $coll= ucs2_lithuanian_ci;
563 --source suite/funcs_2/include/check_charset_ucs2.inc
566 let $coll= ucs2_persian_ci;
567 --source suite/funcs_2/include/check_charset_ucs2.inc
570 let $coll= ucs2_polish_ci;
571 --source suite/funcs_2/include/check_charset_ucs2.inc
574 let $coll= ucs2_roman_ci;
575 --source suite/funcs_2/include/check_charset_ucs2.inc
578 let $coll= ucs2_romanian_ci;
579 --source suite/funcs_2/include/check_charset_ucs2.inc
582 let $coll= ucs2_slovak_ci;
583 --source suite/funcs_2/include/check_charset_ucs2.inc
586 let $coll= ucs2_slovenian_ci;
587 --source suite/funcs_2/include/check_charset_ucs2.inc
590 let $coll= ucs2_spanish2_ci;
591 --source suite/funcs_2/include/check_charset_ucs2.inc
594 let $coll= ucs2_spanish_ci;
595 --source suite/funcs_2/include/check_charset_ucs2.inc
598 let $coll= ucs2_swedish_ci;
599 --source suite/funcs_2/include/check_charset_ucs2.inc
602 let $coll= ucs2_turkish_ci;
603 --source suite/funcs_2/include/check_charset_ucs2.inc
606 let $coll= ucs2_unicode_ci;
607 --source suite/funcs_2/include/check_charset_ucs2.inc
611 if ($check_utf8_csets)
618 --source suite/funcs_2/include/check_charset_utf8.inc
621 let $coll= utf8_czech_ci;
622 --source suite/funcs_2/include/check_charset_utf8.inc
625 let $coll= utf8_danish_ci;
626 --source suite/funcs_2/include/check_charset_utf8.inc
629 let $coll= utf8_estonian_ci;
630 --source suite/funcs_2/include/check_charset_utf8.inc
633 let $coll= utf8_general_ci;
634 --source suite/funcs_2/include/check_charset_utf8.inc
637 let $coll= utf8_hungarian_ci;
638 --source suite/funcs_2/include/check_charset_utf8.inc
641 let $coll= utf8_icelandic_ci;
642 --source suite/funcs_2/include/check_charset_utf8.inc
645 let $coll= utf8_latvian_ci;
646 --source suite/funcs_2/include/check_charset_utf8.inc
649 let $coll= utf8_lithuanian_ci;
650 --source suite/funcs_2/include/check_charset_utf8.inc
653 let $coll= utf8_persian_ci;
654 --source suite/funcs_2/include/check_charset_utf8.inc
657 let $coll= utf8_polish_ci;
658 --source suite/funcs_2/include/check_charset_utf8.inc
661 let $coll= utf8_roman_ci;
662 --source suite/funcs_2/include/check_charset_utf8.inc
665 let $coll= utf8_romanian_ci;
666 --source suite/funcs_2/include/check_charset_utf8.inc
669 let $coll= utf8_slovak_ci;
670 --source suite/funcs_2/include/check_charset_utf8.inc
673 let $coll= utf8_slovenian_ci;
674 --source suite/funcs_2/include/check_charset_utf8.inc
677 let $coll= utf8_spanish2_ci;
678 --source suite/funcs_2/include/check_charset_utf8.inc
681 let $coll= utf8_spanish_ci;
682 --source suite/funcs_2/include/check_charset_utf8.inc
685 let $coll= utf8_swedish_ci;
686 --source suite/funcs_2/include/check_charset_utf8.inc
689 let $coll= utf8_turkish_ci;
690 --source suite/funcs_2/include/check_charset_utf8.inc
693 let $coll= utf8_unicode_ci;
694 --source suite/funcs_2/include/check_charset_utf8.inc