Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1

into mc05.(none):/space2/tomas/mysql-4.1-ndb-test
This commit is contained in:
tomas@mc05.(none) 2004-05-25 14:40:21 +02:00
commit f326e8b2ed
17 changed files with 76 additions and 35 deletions

View file

@ -188,7 +188,7 @@ typedef struct my_charset_handler_st
} MY_CHARSET_HANDLER;
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
typedef struct charset_info_st
@ -204,6 +204,7 @@ typedef struct charset_info_st
uchar *to_lower;
uchar *to_upper;
uchar *sort_order;
uint16 **sort_order_big;
uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni;
uchar state_map[256];

View file

@ -466,7 +466,8 @@ static my_bool init_available_charsets(myf myflags)
if (*cs)
{
set_max_sort_char(*cs);
init_state_maps(*cs);
if (cs[0]->ctype)
init_state_maps(*cs);
}
}

View file

@ -6317,6 +6317,7 @@ CHARSET_INFO my_charset_big5_chinese_ci=
to_lower_big5,
to_upper_big5,
sort_order_big5,
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
@ -6342,6 +6343,7 @@ CHARSET_INFO my_charset_big5_bin=
to_lower_big5,
to_upper_big5,
sort_order_big5,
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",

View file

@ -384,7 +384,9 @@ CHARSET_INFO my_charset_bin =
bin_char_array, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
1, /* mbminlen */
1, /* mbmaxlen */

View file

@ -593,6 +593,7 @@ CHARSET_INFO my_charset_latin2_czech_ci =
to_lower_czech,
to_upper_czech,
sort_order_czech,
NULL, /* sort_order_big*/
tab_8859_2_uni, /* tab_to_uni */
idx_uni_8859_2, /* tab_from_uni */
"","",

View file

@ -8685,6 +8685,7 @@ CHARSET_INFO my_charset_euckr_korean_ci=
to_lower_euc_kr,
to_upper_euc_kr,
sort_order_euc_kr,
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
@ -8710,6 +8711,7 @@ CHARSET_INFO my_charset_euckr_bin=
to_lower_euc_kr,
to_upper_euc_kr,
sort_order_euc_kr,
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",

View file

@ -28,6 +28,7 @@ CHARSET_INFO compiled_charsets[] = {
NULL,
NULL,
NULL,
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",

View file

@ -5738,6 +5738,7 @@ CHARSET_INFO my_charset_gb2312_chinese_ci=
sort_order_gb2312,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@ -5762,6 +5763,7 @@ CHARSET_INFO my_charset_gb2312_bin=
sort_order_gb2312,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */

View file

@ -9968,6 +9968,7 @@ CHARSET_INFO my_charset_gbk_chinese_ci=
sort_order_gbk,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@ -9992,6 +9993,7 @@ CHARSET_INFO my_charset_gbk_bin=
sort_order_gbk,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */

View file

@ -416,6 +416,7 @@ CHARSET_INFO my_charset_latin1=
to_lower_latin1,
to_upper_latin1,
sort_order_latin1,
NULL, /* sort_order_big*/
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
@ -693,6 +694,7 @@ CHARSET_INFO my_charset_latin1_german2_ci=
to_lower_latin1,
to_upper_latin1,
sort_order_latin1_de,
NULL, /* sort_order_big*/
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
@ -717,6 +719,7 @@ CHARSET_INFO my_charset_latin1_bin=
to_lower_latin1,
to_upper_latin1,
sort_order_latin1_de,
NULL, /* sort_order_big*/
cs_to_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
"",

View file

@ -4585,6 +4585,7 @@ CHARSET_INFO my_charset_sjis_japanese_ci=
sort_order_sjis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@ -4609,6 +4610,7 @@ CHARSET_INFO my_charset_sjis_bin=
sort_order_sjis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */

View file

@ -957,6 +957,7 @@ CHARSET_INFO my_charset_tis620_thai_ci=
sort_order_tis620,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
4, /* strxfrm_multiply */
@ -981,6 +982,7 @@ CHARSET_INFO my_charset_tis620_bin=
sort_order_tis620,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */

View file

@ -6436,7 +6436,7 @@ uint16 page0FFdata[]= { /* FF00 (3 weights per char) */
0x0DC5,0x0000,0x0000, 0x0DC6,0x0000,0x0000, 0xFBC1,0xFFFE,0x0000,
0xFBC1,0xFFFF,0x0000 };
uchar ucal[256]={
uchar uca_length[256]={
4,3,3,4,3,3,3,3,0,3,3,3,3,3,3,3,
3,3,3,3,3,2,3,3,3,3,0,0,0,3,3,3,
5,5,4,3,5,2,3,3,2,2,5,3,0,0,3,3,
@ -6454,7 +6454,7 @@ uchar ucal[256]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,3,3,4,3,9,3,3
};
uint16 *ucaw[256]={
uint16 *uca_weight[256]={
page000data,page001data,page002data,page003data,
page004data,page005data,page006data,page007data,
NULL ,page009data,page00Adata,page00Bdata,
@ -6533,6 +6533,8 @@ typedef struct my_uca_scanner_st
const uint16 *wbeg; /* Beginning of the current weight string */
const uchar *sbeg; /* Beginning of the input string */
const uchar *send; /* End of the input string */
uchar *uca_length;
uint16 **uca_weight;
uint16 implicit[2];
int page;
int code;
@ -6564,6 +6566,8 @@ static void my_uca_scanner_init(my_uca_scanner *scanner,
scanner->sbeg= str;
scanner->send= str + length - 2;
scanner->wbeg= nochar;
scanner->uca_length= cs->sort_order;
scanner->uca_weight= cs->sort_order_big;
}
@ -6620,6 +6624,9 @@ static int my_uca_scanner_next(my_uca_scanner *scanner)
do
{
uint16 **ucaw= scanner->uca_weight;
uchar *ucal= scanner->uca_length;
if (scanner->sbeg > scanner->send)
return -1;
@ -6866,10 +6873,12 @@ static int my_strnxfrm_uca(CHARSET_INFO *cs,
This fact allows us to use memcmp() safely, on both
little-endian and big-endian machines.
*/
static int my_uca_charcmp(my_wc_t wc1, my_wc_t wc2)
static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2)
{
size_t page1= wc1 >> MY_UCA_PSHIFT;
size_t page2= wc2 >> MY_UCA_PSHIFT;
uchar *ucal= cs->sort_order;
uint16 **ucaw= cs->sort_order_big;
size_t length1= ucal[page1];
size_t length2= ucal[page2];
uint16 *weight1= ucaw[page1] + (wc1 & MY_UCA_CMASK) * ucal[page1];
@ -6943,7 +6952,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
}
else
{
if (my_uca_charcmp(s_wc,w_wc))
if (my_uca_charcmp(cs,s_wc,w_wc))
return 1;
}
if (wildstr == wildend)
@ -7006,7 +7015,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs,
(const uchar*)str_end)) <= 0)
return 1;
if (!my_uca_charcmp(s_wc,w_wc))
if (!my_uca_charcmp(cs,s_wc,w_wc))
break;
str+= scan;
}
@ -7039,4 +7048,30 @@ MY_COLLATION_HANDLER my_collation_ucs2_uca_handler =
my_hash_sort_uca
};
CHARSET_INFO my_charset_ucs2_general_uca=
{
45,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONTEXT,
"ucs2", /* cs name */
"ucs2_general_uca", /* name */
"", /* comment */
NULL, /* ctype */
NULL, /* to_lower */
NULL, /* to_upper */
uca_length, /* sort_order */
uca_weight, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",
"",
8, /* strxfrm_multiply */
2, /* mbminlen */
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
};
#endif

View file

@ -1397,7 +1397,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
};
static MY_CHARSET_HANDLER my_charset_ucs2_handler=
MY_CHARSET_HANDLER my_charset_ucs2_handler=
{
my_ismbchar_ucs2, /* ismbchar */
my_mbcharlen_ucs2, /* mbcharlen */
@ -1437,6 +1437,7 @@ CHARSET_INFO my_charset_ucs2_general_ci=
to_upper_ucs2, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@ -1448,30 +1449,6 @@ CHARSET_INFO my_charset_ucs2_general_ci=
&my_collation_ucs2_general_ci_handler
};
CHARSET_INFO my_charset_ucs2_general_uca=
{
45,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONTEXT,
"ucs2", /* cs name */
"ucs2_general_uca", /* 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 */
"",
"",
8, /* strxfrm_multiply */
2, /* mbminlen */
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
};
CHARSET_INFO my_charset_ucs2_bin=
{
90,0,0, /* number */
@ -1483,6 +1460,7 @@ CHARSET_INFO my_charset_ucs2_bin=
to_lower_ucs2, /* to_lower */
to_upper_ucs2, /* to_upper */
to_upper_ucs2, /* sort_order */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"",

View file

@ -8474,7 +8474,9 @@ CHARSET_INFO my_charset_ujis_japanese_ci=
sort_order_ujis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
1, /* mbminlen */
3, /* mbmaxlen */
@ -8498,7 +8500,9 @@ CHARSET_INFO my_charset_ujis_bin=
sort_order_ujis,
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
1, /* mbminlen */
3, /* mbmaxlen */

View file

@ -2090,6 +2090,7 @@ CHARSET_INFO my_charset_utf8_general_ci=
to_upper_utf8, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */
@ -2115,6 +2116,7 @@ CHARSET_INFO my_charset_utf8_bin=
to_upper_utf8, /* sort_order */
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* sort_order_big*/
"",
"",
1, /* strxfrm_multiply */

View file

@ -627,6 +627,7 @@ CHARSET_INFO my_charset_cp1250_czech_ci =
to_lower_win1250ch,
to_upper_win1250ch,
sort_order_win1250ch,
NULL, /* sort_order_big*/
tab_cp1250_uni, /* tab_to_uni */
idx_uni_cp1250, /* tab_from_uni */
"","",