http://bugs.mysql.com/bug.php?id=1264
This commit is contained in:
bar@bar.mysql.r18.ru 2003-09-16 15:43:17 +05:00
commit 83c6946232
15 changed files with 48 additions and 9 deletions

View file

@ -6243,6 +6243,7 @@ static MY_CHARSET_HANDLER my_charset_big5_handler=
mbcharlen_big5,
my_numchars_mb,
my_charpos_mb,
my_lengthsp_8bit,
my_mb_wc_big5, /* mb_wc */
my_wc_mb_big5, /* wc_mb */
my_caseup_str_mb,

View file

@ -280,6 +280,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
my_lengthsp_8bit,
my_mb_wc_bin,
my_wc_mb_bin,
my_caseup_str_bin,

View file

@ -8652,6 +8652,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_euc_kr,
my_numchars_mb,
my_charpos_mb,
my_lengthsp_8bit,
my_mb_wc_euc_kr, /* mb_wc */
my_wc_mb_euc_kr, /* wc_mb */
my_caseup_str_mb,

View file

@ -5702,6 +5702,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_gb2312,
my_numchars_mb,
my_charpos_mb,
my_lengthsp_8bit,
my_mb_wc_gb2312, /* mb_wc */
my_wc_mb_gb2312, /* wc_mb */
my_caseup_str_mb,

View file

@ -9899,6 +9899,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_gbk,
my_numchars_mb,
my_charpos_mb,
my_lengthsp_8bit,
my_mb_wc_gbk,
my_wc_mb_gbk,
my_caseup_str_mb,

View file

@ -180,6 +180,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
NULL,
my_numchars_8bit,
my_charpos_8bit,
my_lengthsp_8bit,
my_mb_wc_latin1,
my_wc_mb_latin1,
my_caseup_str_8bit,

View file

@ -1020,12 +1020,23 @@ uint my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
return pos;
}
uint my_lengthsp_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr, uint length)
{
const char *end= ptr+length;
while (end > ptr && end[-1] == ' ')
end--;
return (uint) (end-ptr);
}
MY_CHARSET_HANDLER my_charset_8bit_handler=
{
NULL, /* ismbchar */
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
my_lengthsp_8bit,
my_mb_wc_8bit,
my_wc_mb_8bit,
my_caseup_str_8bit,

View file

@ -4486,6 +4486,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_sjis,
my_numchars_mb,
my_charpos_mb,
my_lengthsp_8bit,
my_mb_wc_sjis, /* mb_wc */
my_wc_mb_sjis, /* wc_mb */
my_caseup_str_8bit,

View file

@ -719,6 +719,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
my_lengthsp_8bit,
my_mb_wc_8bit, /* mb_wc */
my_wc_mb_8bit, /* wc_mb */
my_caseup_str_8bit,

View file

@ -1001,6 +1001,24 @@ uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
return pos*2;
}
static
void my_fill_ucs2(CHARSET_INFO *cs __attribute__((unused)),
char *s, uint l, int fill)
{
for ( ; l >= 2; s[0]= 0, s[1]= fill, s+=2, l-=2);
}
static
uint my_lengthsp_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr, uint length)
{
const char *end= ptr+length;
while (end > ptr+1 && end[-1] == ' ' && end[-2] == '\0')
end-=2;
return (uint) (end-ptr);
}
static MY_COLLATION_HANDLER my_collation_ci_handler =
{
@ -1019,6 +1037,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_mbcharlen_ucs2, /* mbcharlen */
my_numchars_ucs2,
my_charpos_ucs2,
my_lengthsp_ucs2,
my_ucs2_uni, /* mb_wc */
my_uni_ucs2, /* wc_mb */
my_caseup_str_ucs2,
@ -1028,7 +1047,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_snprintf_ucs2,
my_l10tostr_ucs2,
my_ll10tostr_ucs2,
my_fill_8bit,
my_fill_ucs2,
my_strntol_ucs2,
my_strntoul_ucs2,
my_strntoll_ucs2,

View file

@ -8443,6 +8443,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_ujis,
my_numchars_mb,
my_charpos_mb,
my_lengthsp_8bit,
my_mb_wc_euc_jp, /* mb_wc */
my_wc_mb_euc_jp, /* wc_mb */
my_caseup_str_mb,

View file

@ -1968,6 +1968,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_mbcharlen_utf8,
my_numchars_mb,
my_charpos_mb,
my_lengthsp_8bit,
my_utf8_uni,
my_uni_utf8,
my_caseup_str_utf8,