BINARY collations for every character set

This commit is contained in:
unknown 2003-05-23 18:39:55 +05:00
parent 5aae66c101
commit afc8396919
12 changed files with 300 additions and 23 deletions

View file

@ -395,13 +395,16 @@ CHARSET_INFO *default_charset_info = &my_charset_latin1;
static my_bool init_compiled_charsets(myf flags __attribute__((unused)))
{
CHARSET_INFO *cs;
MY_ADD_CHARSET(&my_charset_bin);
MY_ADD_CHARSET(&my_charset_latin1);
MY_ADD_CHARSET(&my_charset_bin);
MY_ADD_CHARSET(&my_charset_latin1_bin);
MY_ADD_CHARSET(&my_charset_latin1_german2_ci);
#ifdef HAVE_CHARSET_big5
MY_ADD_CHARSET(&my_charset_big5_chinese_ci);
MY_ADD_CHARSET(&my_charset_big5_bin);
#endif
#ifdef HAVE_CHARSET_czech
@ -410,34 +413,42 @@ static my_bool init_compiled_charsets(myf flags __attribute__((unused)))
#ifdef HAVE_CHARSET_euc_kr
MY_ADD_CHARSET(&my_charset_euckr_korean_ci);
MY_ADD_CHARSET(&my_charset_euckr_bin);
#endif
#ifdef HAVE_CHARSET_gb2312
MY_ADD_CHARSET(&my_charset_gb2312_chinese_ci);
MY_ADD_CHARSET(&my_charset_gb2312_bin);
#endif
#ifdef HAVE_CHARSET_gbk
MY_ADD_CHARSET(&my_charset_gbk_chinese_ci);
MY_ADD_CHARSET(&my_charset_gbk_bin);
#endif
#ifdef HAVE_CHARSET_sjis
MY_ADD_CHARSET(&my_charset_sjis_japanese_ci);
MY_ADD_CHARSET(&my_charset_sjis_bin);
#endif
#ifdef HAVE_CHARSET_tis620
MY_ADD_CHARSET(&my_charset_tis620_thai_ci);
MY_ADD_CHARSET(&my_charset_tis620_bin);
#endif
#ifdef HAVE_CHARSET_ucs2
MY_ADD_CHARSET(&my_charset_ucs2_general_ci);
MY_ADD_CHARSET(&my_charset_ucs2_bin);
#endif
#ifdef HAVE_CHARSET_ujis
MY_ADD_CHARSET(&my_charset_ujis_japanese_ci);
MY_ADD_CHARSET(&my_charset_ujis_bin);
#endif
#ifdef HAVE_CHARSET_utf8
MY_ADD_CHARSET(&my_charset_utf8_general_ci);
MY_ADD_CHARSET(&my_charset_utf8_bin);
#endif
#ifdef HAVE_CHARSET_win1250ch

View file

@ -1,6 +1,6 @@
<?xml version='1.0' encoding="utf-8"?>
<charsets max-id="83">
<charsets max-id="91">
<description>
This file lists all of the available character sets.
@ -21,6 +21,10 @@ To make maintaining easier please:
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="big5_bin" id="84" order="Binary">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
<charset name="latin2">
@ -96,7 +100,10 @@ To make maintaining easier please:
<collation name="latin1_swedish_ci" id="8" order="Finnish, Swedish" flag="primary"/>
<collation name="latin1_danish_ci" id="15" order="Danish"/>
<collation name="latin1_german2_ci" id="31" order="German Phonebook" flag="compiled"/>
<collation name="latin1_bin" id="47" order="Binary" flag="binary"/>
<collation name="latin1_bin" id="47" order="Binary">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
<collation name="latin1_general_ci" id="48">
<order>Dutch</order>
<order>English</order>
@ -173,6 +180,10 @@ To make maintaining easier please:
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="ujis_bin" id="91" order="Japanese">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
<charset name="sjis">
@ -185,6 +196,10 @@ To make maintaining easier please:
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="sjis_bin" id="88" order="Binary">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
<charset name="cp1251">
@ -242,6 +257,10 @@ To make maintaining easier please:
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="tis620_bin" id="89" order="Binary">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
<charset name="euckr">
@ -253,6 +272,10 @@ To make maintaining easier please:
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="euckr_bin" id="85">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
<charset name="latin7">
@ -293,6 +316,10 @@ To make maintaining easier please:
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="gb2312_bin" id="86">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
<charset name="greek">
@ -333,6 +360,10 @@ To make maintaining easier please:
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="gbk_bin" id="87" order="Binary">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
<charset name="cp1257">
@ -386,6 +417,10 @@ To make maintaining easier please:
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="ucs2_bin" id="90">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>
<charset name="cp866">

View file

@ -6262,7 +6262,7 @@ static MY_CHARSET_HANDLER my_charset_big5_handler=
my_scan_8bit
};
CHARSET_INFO my_charset_big5_chinese_ci =
CHARSET_INFO my_charset_big5_chinese_ci=
{
1,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */
@ -6275,7 +6275,8 @@ CHARSET_INFO my_charset_big5_chinese_ci =
sort_order_big5,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
"",
"",
1, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
@ -6284,5 +6285,27 @@ CHARSET_INFO my_charset_big5_chinese_ci =
};
CHARSET_INFO my_charset_big5_bin=
{
84,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
"big5", /* cs name */
"big5_bin", /* name */
"", /* comment */
ctype_big5,
to_lower_big5,
to_upper_big5,
sort_order_big5,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
0, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
&my_charset_big5_handler,
&my_collation_bin_handler
};
#endif

View file

@ -8671,7 +8671,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
};
CHARSET_INFO my_charset_euckr_korean_ci =
CHARSET_INFO my_charset_euckr_korean_ci=
{
19,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY, /* state */
@ -8684,7 +8684,8 @@ CHARSET_INFO my_charset_euckr_korean_ci =
sort_order_euc_kr,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
"",
"",
0, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
@ -8692,4 +8693,27 @@ CHARSET_INFO my_charset_euckr_korean_ci =
&my_collation_ci_handler
};
CHARSET_INFO my_charset_euckr_bin=
{
85,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
"euckr", /* cs name */
"euckr_bin", /* name */
"", /* comment */
ctype_euc_kr,
to_lower_euc_kr,
to_upper_euc_kr,
sort_order_euc_kr,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
0, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_bin_handler
};
#endif

View file

@ -5721,7 +5721,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
};
CHARSET_INFO my_charset_gb2312_chinese_ci =
CHARSET_INFO my_charset_gb2312_chinese_ci=
{
24,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY, /* state */
@ -5734,7 +5734,8 @@ CHARSET_INFO my_charset_gb2312_chinese_ci =
sort_order_gb2312,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
"",
"",
0, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
@ -5742,4 +5743,26 @@ CHARSET_INFO my_charset_gb2312_chinese_ci =
&my_collation_ci_handler
};
CHARSET_INFO my_charset_gb2312_bin=
{
86,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
"gb2312", /* cs name */
"gb2312_bin", /* name */
"", /* comment */
ctype_gb2312,
to_lower_gb2312,
to_upper_gb2312,
sort_order_gb2312,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
0, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_bin_handler
};
#endif

View file

@ -9918,7 +9918,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
};
CHARSET_INFO my_charset_gbk_chinese_ci =
CHARSET_INFO my_charset_gbk_chinese_ci=
{
28,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */
@ -9931,7 +9931,8 @@ CHARSET_INFO my_charset_gbk_chinese_ci =
sort_order_gbk,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
"",
"",
1, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
@ -9939,5 +9940,27 @@ CHARSET_INFO my_charset_gbk_chinese_ci =
&my_collation_ci_handler
};
CHARSET_INFO my_charset_gbk_bin=
{
87,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
"gbk", /* cs name */
"gbk_bin", /* name */
"", /* comment */
ctype_gbk,
to_lower_gbk,
to_upper_gbk,
sort_order_gbk,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
0, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_bin_handler
};
#endif

View file

@ -199,7 +199,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
};
CHARSET_INFO my_charset_latin1 =
CHARSET_INFO my_charset_latin1=
{
8,0,0, /* number */
MY_CS_COMPILED | MY_CS_PRIMARY, /* state */
@ -428,7 +428,7 @@ static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
}
static MY_COLLATION_HANDLER my_collation_german2_ci_handler =
static MY_COLLATION_HANDLER my_collation_german2_ci_handler=
{
my_strnncoll_latin1_de,
my_strnncollsp_latin1_de,
@ -440,7 +440,7 @@ static MY_COLLATION_HANDLER my_collation_german2_ci_handler =
};
CHARSET_INFO my_charset_latin1_german2_ci =
CHARSET_INFO my_charset_latin1_german2_ci=
{
31,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
@ -461,3 +461,26 @@ CHARSET_INFO my_charset_latin1_german2_ci =
&my_collation_german2_ci_handler
};
CHARSET_INFO my_charset_latin1_bin=
{
47,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
"latin1", /* cs name */
"latin1_bin", /* name */
"", /* comment */
ctype_latin1,
to_lower_latin1,
to_upper_latin1,
sort_order_latin1_de,
latin1_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
0, /* strxfrm_multiply */
1, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_bin_handler
};

View file

@ -4505,7 +4505,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
};
CHARSET_INFO my_charset_sjis_japanese_ci =
CHARSET_INFO my_charset_sjis_japanese_ci=
{
13,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */
@ -4518,13 +4518,35 @@ CHARSET_INFO my_charset_sjis_japanese_ci =
sort_order_sjis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
"",
"",
1, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_ci_handler
};
CHARSET_INFO my_charset_sjis_bin=
{
88,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
"sjis", /* cs name */
"sjis_bin", /* name */
"", /* comment */
ctype_sjis,
to_lower_sjis,
to_upper_sjis,
sort_order_sjis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
0, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_bin_handler
};
#endif

View file

@ -725,7 +725,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
CHARSET_INFO my_charset_tis620_thai_ci =
CHARSET_INFO my_charset_tis620_thai_ci=
{
18,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */
@ -738,7 +738,8 @@ CHARSET_INFO my_charset_tis620_thai_ci =
sort_order_tis620,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
"",
"",
4, /* strxfrm_multiply */
1, /* mbmaxlen */
0,
@ -746,5 +747,27 @@ CHARSET_INFO my_charset_tis620_thai_ci =
&my_collation_ci_handler
};
CHARSET_INFO my_charset_tis620_bin=
{
89,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
"tis620", /* cs name */
"tis620_bin", /* name */
"", /* comment */
ctype_tis620,
to_lower_tis620,
to_upper_tis620,
sort_order_tis620,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
0, /* strxfrm_multiply */
1, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_bin_handler
};
#endif

View file

@ -1035,7 +1035,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
CHARSET_INFO my_charset_ucs2_general_ci =
CHARSET_INFO my_charset_ucs2_general_ci=
{
35,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE, /* state */
@ -1048,7 +1048,8 @@ CHARSET_INFO my_charset_ucs2_general_ci =
to_upper_ucs2, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
"",
"",
1, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
@ -1057,4 +1058,27 @@ CHARSET_INFO my_charset_ucs2_general_ci =
};
CHARSET_INFO my_charset_ucs2_bin=
{
90,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE, /* state */
"ucs2", /* cs name */
"ucs2_bin", /* name */
"", /* comment */
ctype_ucs2, /* ctype */
to_lower_ucs2, /* to_lower */
to_upper_ucs2, /* to_upper */
to_upper_ucs2, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
0, /* strxfrm_multiply */
2, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_bin_handler
};
#endif

View file

@ -8463,7 +8463,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
CHARSET_INFO my_charset_ujis_japanese_ci =
CHARSET_INFO my_charset_ujis_japanese_ci=
{
12,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY, /* state */
@ -8485,4 +8485,26 @@ CHARSET_INFO my_charset_ujis_japanese_ci =
};
CHARSET_INFO my_charset_ujis_bin=
{
91,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT, /* state */
"ujis", /* cs name */
"ujis_bin", /* name */
"", /* comment */
ctype_ujis,
to_lower_ujis,
to_upper_ujis,
sort_order_ujis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
0, /* strxfrm_multiply */
3, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_bin_handler
};
#endif

View file

@ -1988,7 +1988,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
CHARSET_INFO my_charset_utf8_general_ci =
CHARSET_INFO my_charset_utf8_general_ci=
{
33,0,0, /* number */
MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE, /* state */
@ -2001,7 +2001,8 @@ CHARSET_INFO my_charset_utf8_general_ci =
to_upper_utf8, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
"",
"",
1, /* strxfrm_multiply */
3, /* mbmaxlen */
0,
@ -2010,6 +2011,29 @@ CHARSET_INFO my_charset_utf8_general_ci =
};
CHARSET_INFO my_charset_utf8_bin=
{
83,0,0, /* number */
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE, /* state */
"utf8", /* cs name */
"utf8_bin", /* name */
"", /* comment */
ctype_utf8, /* ctype */
to_lower_utf8, /* to_lower */
to_upper_utf8, /* to_upper */
to_upper_utf8, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
0, /* strxfrm_multiply */
3, /* mbmaxlen */
0,
&my_charset_handler,
&my_collation_ci_handler
};
#ifdef MY_TEST_UTF8
#include <stdio.h>