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
parent 710599ca2e
commit 83c6946232
15 changed files with 48 additions and 9 deletions

View File

@ -131,6 +131,7 @@ typedef struct my_charset_handler_st
int (*mbcharlen)(struct charset_info_st *, uint);
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
/* Unicode convertion */
int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
@ -240,6 +241,8 @@ extern void my_hash_sort_simple(CHARSET_INFO *cs,
const uchar *key, uint len,
ulong *nr1, ulong *nr2);
extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length);
/* Functions for 8bit */
extern void my_caseup_str_8bit(CHARSET_INFO *, char *);

View File

@ -1433,7 +1433,7 @@ CYR CAPIT EM М М
CYR CAPIT EN Ð<> Ð<> î Ð<>
CYR CAPIT O О О ï О
CYR CAPIT PE П П ð П
CYR CAPIT ER Р Р ò
CYR CAPIT ER Р Р ò Р
CYR CAPIT ES С С ó С
CYR CAPIT TE Т Т ô Т
CYR CAPIT U У У õ У
@ -1574,7 +1574,7 @@ CYR CAPIT EM
CYR CAPIT EN î Ð<> î 
CYR CAPIT O ï О ï 
CYR CAPIT PE ð П ð 
CYR CAPIT ER ò Р ò 
CYR CAPIT ER ò Р ò 
CYR CAPIT ES ó С ó !
CYR CAPIT TE ô Т ô "
CYR CAPIT U õ У õ #

View File

@ -3975,12 +3975,8 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
char *end=ptr+field_length;
#ifdef WANT_TRUE_BINARY_STRINGS
if (!binary)
#endif
while (end > ptr && end[-1] == ' ')
end--;
val_ptr->set((const char*) ptr,(uint) (end - ptr),field_charset);
uint length= field_charset->cset->lengthsp(field_charset, ptr, field_length);
val_ptr->set((const char*) ptr, length, field_charset);
return val_ptr;
}

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,