Commit edb8ae0f authored by unknown's avatar unknown

Simple charsets now have strncoll() field too

parent ac97cce4
...@@ -507,7 +507,7 @@ int sortcmp(const String *x,const String *y) ...@@ -507,7 +507,7 @@ int sortcmp(const String *x,const String *y)
uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len); uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len);
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(x->str_charset)) if (use_strnxfrm(x->str_charset))
{ {
#ifndef CMP_ENDSPACE #ifndef CMP_ENDSPACE
while (x_len && my_isspace(x->str_charset,s[x_len-1])) while (x_len && my_isspace(x->str_charset,s[x_len-1]))
......
...@@ -92,12 +92,13 @@ typedef struct charset_info_st ...@@ -92,12 +92,13 @@ typedef struct charset_info_st
int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc, int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
unsigned char *s,unsigned char *e); unsigned char *s,unsigned char *e);
/* Functions for case convertion */ /* Functions for case and sort convertion */
void (*caseup_str)(struct charset_info_st *, char *); void (*caseup_str)(struct charset_info_st *, char *);
void (*casedn_str)(struct charset_info_st *, char *); void (*casedn_str)(struct charset_info_st *, char *);
void (*caseup)(struct charset_info_st *, char *, uint); void (*caseup)(struct charset_info_st *, char *, uint);
void (*casedn)(struct charset_info_st *, char *, uint); void (*casedn)(struct charset_info_st *, char *, uint);
void (*tosort)(struct charset_info_st *, char *, uint);
/* Functions for case comparison */ /* Functions for case comparison */
int (*strcasecmp)(struct charset_info_st *, const char *, const char *); int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
int (*strncasecmp)(struct charset_info_st *, const char *, const char *, int (*strncasecmp)(struct charset_info_st *, const char *, const char *,
...@@ -125,14 +126,15 @@ extern const char *compiled_charset_name(uint charset_number); ...@@ -125,14 +126,15 @@ extern const char *compiled_charset_name(uint charset_number);
#define MY_CHARSET_CURRENT (default_charset_info->number) #define MY_CHARSET_CURRENT (default_charset_info->number)
/* declarations for simple charsets */ /* declarations for simple charsets */
extern int my_strnxfrm_simple(CHARSET_INFO *, char *, uint, const char *, uint); extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *, uint);
extern int my_strnncoll_simple(CHARSET_INFO *, const char *, uint, const char *, uint); extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint, const uchar *, uint);
/* Functions for 8bit */ /* Functions for 8bit */
extern void my_caseup_str_8bit(CHARSET_INFO *, char *); extern void my_caseup_str_8bit(CHARSET_INFO *, char *);
extern void my_casedn_str_8bit(CHARSET_INFO *, char *); extern void my_casedn_str_8bit(CHARSET_INFO *, char *);
extern void my_caseup_8bit(CHARSET_INFO *, char *, uint); extern void my_caseup_8bit(CHARSET_INFO *, char *, uint);
extern void my_casedn_8bit(CHARSET_INFO *, char *, uint); extern void my_casedn_8bit(CHARSET_INFO *, char *, uint);
extern void my_tosort_8bit(CHARSET_INFO *, char *, uint);
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *); extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
extern int my_strncasecmp_8bit(CHARSET_INFO * cs, const char *, const char *, uint); extern int my_strncasecmp_8bit(CHARSET_INFO * cs, const char *, const char *, uint);
...@@ -364,7 +366,7 @@ void my_hash_sort_ucs2(struct charset_info_st *cs, const uchar *key, uint len, u ...@@ -364,7 +366,7 @@ void my_hash_sort_ucs2(struct charset_info_st *cs, const uchar *key, uint len, u
#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_') #define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_')
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_') #define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
#define use_strcoll(s) ((s)->strnncoll != NULL) #define use_strnxfrm(s) ((s)->strnxfrm != NULL)
#define my_strnxfrm(s, a, b, c, d) ((s)->strnxfrm((s), (a), (b), (c), (d))) #define my_strnxfrm(s, a, b, c, d) ((s)->strnxfrm((s), (a), (b), (c), (d)))
#define my_strnncoll(s, a, b, c, d) ((s)->strnncoll((s), (a), (b), (c), (d))) #define my_strnncoll(s, a, b, c, d) ((s)->strnncoll((s), (a), (b), (c), (d)))
#define my_like_range(s, a, b, c, d, e, f, g, h) \ #define my_like_range(s, a, b, c, d, e, f, g, h) \
...@@ -377,6 +379,7 @@ void my_hash_sort_ucs2(struct charset_info_st *cs, const uchar *key, uint len, u ...@@ -377,6 +379,7 @@ void my_hash_sort_ucs2(struct charset_info_st *cs, const uchar *key, uint len, u
#define my_caseup(s, a, l) ((s)->caseup((s), (a), (l))) #define my_caseup(s, a, l) ((s)->caseup((s), (a), (l)))
#define my_casedn(s, a, l) ((s)->casedn((s), (a), (l))) #define my_casedn(s, a, l) ((s)->casedn((s), (a), (l)))
#define my_tosort(s, a, l) ((s)->tosort((s), (a), (l)))
#define my_caseup_str(s, a) ((s)->caseup_str((s), (a))) #define my_caseup_str(s, a) ((s)->caseup_str((s), (a)))
#define my_casedn_str(s, a) ((s)->casedn_str((s), (a))) #define my_casedn_str(s, a) ((s)->casedn_str((s), (a)))
#define my_strcasecmp(s, a, b) ((s)->strcasecmp((s), (a), (b))) #define my_strcasecmp(s, a, b) ((s)->strcasecmp((s), (a), (b)))
......
...@@ -583,7 +583,6 @@ extern void allow_break(void); ...@@ -583,7 +583,6 @@ extern void allow_break(void);
#endif #endif
extern void my_remember_signal(int signal_number,sig_handler (*func)(int)); extern void my_remember_signal(int signal_number,sig_handler (*func)(int));
extern void case_sort(CHARSET_INFO *cs, my_string str,uint length);
extern uint dirname_part(my_string to,const char *name); extern uint dirname_part(my_string to,const char *name);
extern uint dirname_length(const char *name); extern uint dirname_length(const char *name);
#define base_name(A) (A+dirname_length(A)) #define base_name(A) (A+dirname_length(A))
......
...@@ -54,11 +54,11 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char * ...@@ -54,11 +54,11 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char *
*key++= (uchar) (length=(uint) (end-pos)); *key++= (uchar) (length=(uint) (end-pos));
memcpy((byte*) key,(byte*) pos,(size_t) length); memcpy((byte*) key,(byte*) pos,(size_t) length);
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (!use_strcoll(default_charset_info)) if (!use_strnxfrm(default_charset_info))
#endif #endif
{ {
if (type == HA_KEYTYPE_TEXT) if (type == HA_KEYTYPE_TEXT)
case_sort(default_charset_info,(byte*) key,length); my_tosort(default_charset_info,(byte*) key,length);
} }
key+=length; key+=length;
} }
...@@ -67,11 +67,11 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char * ...@@ -67,11 +67,11 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char *
memcpy((byte*) key,(byte*) record+keyseg->base.start, memcpy((byte*) key,(byte*) record+keyseg->base.start,
(size_t) keyseg->base.length); (size_t) keyseg->base.length);
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (!use_strcoll(default_charset_info)) if (!use_strnxfrm(default_charset_info))
#endif #endif
{ {
if (type == HA_KEYTYPE_TEXT) if (type == HA_KEYTYPE_TEXT)
case_sort(default_charset_info,(byte*) key,(uint) keyseg->base.length); my_tosort(default_charset_info,(byte*) key,(uint) keyseg->base.length);
} }
#ifdef NAN_TEST #ifdef NAN_TEST
else if (type == HA_KEYTYPE_FLOAT) else if (type == HA_KEYTYPE_FLOAT)
...@@ -150,11 +150,11 @@ uint _nisam_pack_key(register N_INFO *info, uint keynr, uchar *key, uchar *old, ...@@ -150,11 +150,11 @@ uint _nisam_pack_key(register N_INFO *info, uint keynr, uchar *key, uchar *old,
else else
memcpy((byte*) key,old,(size_t) length); memcpy((byte*) key,old,(size_t) length);
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (!use_strcoll(default_charset_info)) if (!use_strnxfrm(default_charset_info))
#endif #endif
{ {
if (type == HA_KEYTYPE_TEXT) if (type == HA_KEYTYPE_TEXT)
case_sort(default_charset_info,(byte*) key,length); my_tosort(default_charset_info,(byte*) key,length);
} }
key+= length; key+= length;
} }
......
...@@ -332,7 +332,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar ...@@ -332,7 +332,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
end= a+ min(key_length,(uint) length); end= a+ min(key_length,(uint) length);
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(default_charset_info)) { if (use_strnxfrm(default_charset_info)) {
if (((enum ha_base_keytype) keyseg->base.type) == HA_KEYTYPE_BINARY) if (((enum ha_base_keytype) keyseg->base.type) == HA_KEYTYPE_BINARY)
{ {
while (a < end) while (a < end)
...@@ -383,7 +383,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar ...@@ -383,7 +383,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
else else
{ {
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(default_charset_info)) { if (use_strnxfrm(default_charset_info)) {
if (((enum ha_base_keytype) keyseg->base.type) == HA_KEYTYPE_BINARY) if (((enum ha_base_keytype) keyseg->base.type) == HA_KEYTYPE_BINARY)
{ {
while (a < end) while (a < end)
......
...@@ -685,7 +685,7 @@ static void setup_key_functions(register MI_KEYDEF *keyinfo) ...@@ -685,7 +685,7 @@ static void setup_key_functions(register MI_KEYDEF *keyinfo)
keyinfo->get_key= _mi_get_pack_key; keyinfo->get_key= _mi_get_pack_key;
if (keyinfo->seg[0].flag & HA_PACK_KEY) if (keyinfo->seg[0].flag & HA_PACK_KEY)
{ /* Prefix compression */ { /* Prefix compression */
if (!keyinfo->seg->charset || use_strcoll(keyinfo->seg->charset) || if (!keyinfo->seg->charset || use_strnxfrm(keyinfo->seg->charset) ||
(keyinfo->seg->flag & HA_NULL_PART)) (keyinfo->seg->flag & HA_NULL_PART))
keyinfo->bin_search=_mi_seq_search; keyinfo->bin_search=_mi_seq_search;
else else
......
...@@ -1287,7 +1287,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, ...@@ -1287,7 +1287,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
if ((keyinfo->flag & HA_FULLTEXT) && if ((keyinfo->flag & HA_FULLTEXT) &&
((keyseg->type == HA_KEYTYPE_TEXT) || ((keyseg->type == HA_KEYTYPE_TEXT) ||
(keyseg->type == HA_KEYTYPE_VARTEXT)) && (keyseg->type == HA_KEYTYPE_VARTEXT)) &&
!use_strcoll(keyseg->charset)) !use_strnxfrm(keyseg->charset))
sort_order=keyseg->charset->sort_order; sort_order=keyseg->charset->sort_order;
/* diff flag contains how many bytes is needed to pack key */ /* diff flag contains how many bytes is needed to pack key */
......
...@@ -377,6 +377,7 @@ static CHARSET_INFO *add_charset(uint cs_number, myf flags) ...@@ -377,6 +377,7 @@ static CHARSET_INFO *add_charset(uint cs_number, myf flags)
cs->casedn_str = my_casedn_str_8bit; cs->casedn_str = my_casedn_str_8bit;
cs->caseup = my_caseup_8bit; cs->caseup = my_caseup_8bit;
cs->casedn = my_casedn_8bit; cs->casedn = my_casedn_8bit;
cs->tosort = my_tosort_8bit;
cs->strcasecmp = my_strcasecmp_8bit; cs->strcasecmp = my_strcasecmp_8bit;
cs->strncasecmp = my_strncasecmp_8bit; cs->strncasecmp = my_strncasecmp_8bit;
cs->mb_wc = my_mb_wc_8bit; cs->mb_wc = my_mb_wc_8bit;
......
...@@ -15,11 +15,7 @@ ...@@ -15,11 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* /*
Functions to convert to lover_case and to upper_case in scandinavia. Functions to convert to lover_case and to upper_case.
case_sort converts a character string to a representaion that can
be compared by strcmp to find with is alfabetical bigger.
(lower- and uppercase letters is compared as the same)
*/ */
#include "mysys_priv.h" #include "mysys_priv.h"
...@@ -29,21 +25,11 @@ ...@@ -29,21 +25,11 @@
#endif #endif
/* to sort-string that can be compared to get text in order */
void case_sort(CHARSET_INFO *cs, my_string str, uint length)
{
register uchar *map=cs->sort_order;
for ( ; length>0 ; length--, str++)
*str= (char) map[(uchar) *str];
} /* case_sort */
int my_sortcmp(CHARSET_INFO *cs, const char *s, const char *t, uint len) int my_sortcmp(CHARSET_INFO *cs, const char *s, const char *t, uint len)
{ {
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(cs)) if (use_strnxfrm(cs))
return my_strnncoll(cs,(uchar *)s, len, (uchar *)t, len); return my_strnncoll(cs,(uchar *)s, len, (uchar *)t, len);
else else
#endif #endif
...@@ -63,7 +49,7 @@ int my_sortncmp(CHARSET_INFO *cs, ...@@ -63,7 +49,7 @@ int my_sortncmp(CHARSET_INFO *cs,
const char *t, uint t_len) const char *t, uint t_len)
{ {
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(cs)) if (use_strnxfrm(cs))
return my_strnncoll(cs, (uchar *)s, s_len, (uchar *)t, t_len); return my_strnncoll(cs, (uchar *)s, s_len, (uchar *)t, t_len);
else else
#endif #endif
......
...@@ -23,7 +23,7 @@ int mi_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length, ...@@ -23,7 +23,7 @@ int mi_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length,
int flag; int flag;
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(charset_info)) if (use_strnxfrm(charset_info))
{ {
if (part_key && b_length < a_length) if (part_key && b_length < a_length)
a_length=b_length; a_length=b_length;
......
...@@ -3841,7 +3841,7 @@ void Field_string::sort_string(char *to,uint length) ...@@ -3841,7 +3841,7 @@ void Field_string::sort_string(char *to,uint length)
else else
{ {
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(field_charset)) { if (use_strnxfrm(field_charset)) {
uint tmp=my_strnxfrm(field_charset, uint tmp=my_strnxfrm(field_charset,
(unsigned char *)to, length, (unsigned char *)to, length,
(unsigned char *) ptr, field_length); (unsigned char *) ptr, field_length);
...@@ -4045,7 +4045,7 @@ void Field_varstring::sort_string(char *to,uint length) ...@@ -4045,7 +4045,7 @@ void Field_varstring::sort_string(char *to,uint length)
else else
{ {
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(field_charset)) if (use_strnxfrm(field_charset))
tot_length=my_strnxfrm(field_charset, tot_length=my_strnxfrm(field_charset,
(unsigned char *) to, length, (unsigned char *) to, length,
(unsigned char *)ptr+2, tot_length); (unsigned char *)ptr+2, tot_length);
...@@ -4536,7 +4536,7 @@ void Field_blob::sort_string(char *to,uint length) ...@@ -4536,7 +4536,7 @@ void Field_blob::sort_string(char *to,uint length)
else else
{ {
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(field_charset)) if (use_strnxfrm(field_charset))
{ {
blob_length=my_strnxfrm(field_charset, blob_length=my_strnxfrm(field_charset,
(unsigned char *)to, length, (unsigned char *)to, length,
......
...@@ -140,7 +140,7 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length, ...@@ -140,7 +140,7 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
records=param.max_rows; /* purecov: inspected */ records=param.max_rows; /* purecov: inspected */
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(charset) && if (use_strnxfrm(charset) &&
!(param.tmp_buffer=my_malloc(param.sort_length,MYF(MY_WME)))) !(param.tmp_buffer=my_malloc(param.sort_length,MYF(MY_WME))))
goto err; goto err;
#endif #endif
...@@ -511,7 +511,7 @@ static void make_sortkey(register SORTPARAM *param, ...@@ -511,7 +511,7 @@ static void make_sortkey(register SORTPARAM *param,
length=sort_field->length; length=sort_field->length;
} }
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if(use_strcoll(cs)) if(use_strnxfrm(cs))
{ {
if (item->binary) if (item->binary)
{ {
...@@ -541,7 +541,7 @@ static void make_sortkey(register SORTPARAM *param, ...@@ -541,7 +541,7 @@ static void make_sortkey(register SORTPARAM *param,
memcpy(to,res->ptr(),length); memcpy(to,res->ptr(),length);
bzero((char *)to+length,diff); bzero((char *)to+length,diff);
if (!item->binary) if (!item->binary)
case_sort(cs, (char*) to,length); my_tosort(cs, (char*) to,length);
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
} }
#endif #endif
...@@ -946,7 +946,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length) ...@@ -946,7 +946,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
if (!sortorder->field->binary()) if (!sortorder->field->binary())
{ {
CHARSET_INFO *cs=((Field_str*)(sortorder->field))->charset(); CHARSET_INFO *cs=((Field_str*)(sortorder->field))->charset();
if (use_strcoll(cs)) if (use_strnxfrm(cs))
sortorder->length= sortorder->length*cs->strxfrm_multiply; sortorder->length= sortorder->length*cs->strxfrm_multiply;
} }
#endif #endif
...@@ -966,7 +966,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length) ...@@ -966,7 +966,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
if (!sortorder->item->binary) if (!sortorder->item->binary)
{ {
CHARSET_INFO *cs=sortorder->item->str_value.charset(); CHARSET_INFO *cs=sortorder->item->str_value.charset();
if (use_strcoll(cs)) if (use_strnxfrm(cs))
sortorder->length= sortorder->length*cs->strxfrm_multiply; sortorder->length= sortorder->length*cs->strxfrm_multiply;
} }
#endif #endif
......
...@@ -978,7 +978,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part, ...@@ -978,7 +978,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
{ {
CHARSET_INFO *charset=((Field_str*)(field))->charset(); CHARSET_INFO *charset=((Field_str*)(field))->charset();
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(charset)) if (use_strnxfrm(charset))
like_error= my_like_range(charset, like_error= my_like_range(charset,
res->ptr(),res->length(),wild_prefix, res->ptr(),res->length(),wild_prefix,
field_length, min_str+maybe_null, field_length, min_str+maybe_null,
......
...@@ -505,7 +505,7 @@ int sortcmp(const String *x,const String *y) ...@@ -505,7 +505,7 @@ int sortcmp(const String *x,const String *y)
uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len); uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len);
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (use_strcoll(x->str_charset)) if (use_strnxfrm(x->str_charset))
{ {
#ifndef CMP_ENDSPACE #ifndef CMP_ENDSPACE
while (x_len && my_isspace(x->str_charset,s[x_len-1])) while (x_len && my_isspace(x->str_charset,s[x_len-1]))
......
...@@ -20,32 +20,30 @@ ...@@ -20,32 +20,30 @@
#include "assert.h" #include "assert.h"
int my_strnxfrm_simple(CHARSET_INFO * cs, int my_strnxfrm_simple(CHARSET_INFO * cs,
char *dest, uint len, uchar *dest, uint len,
const char *src, uint srclen) const uchar *src, uint srclen)
{ {
uchar *map= cs->sort_order; uchar *map= cs->sort_order;
DBUG_ASSERT(len >= srclen); DBUG_ASSERT(len >= srclen);
for ( ; len > 0 ; len-- ) for ( ; len > 0 ; len-- )
*dest++= (char) map[(uchar) *src++]; *dest++= map[*src++];
return srclen; return srclen;
} }
int my_strnncoll_simple(CHARSET_INFO * cs, const char *s, uint slen, int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, uint slen,
const char *t, uint tlen) const uchar *t, uint tlen)
{ {
int len = ( slen > tlen ) ? tlen : slen; int len = ( slen > tlen ) ? tlen : slen;
uchar *map= cs->sort_order; uchar *map= cs->sort_order;
while (len--) while (len--)
{ {
if (map[(uchar) *s++] != map[(uchar) *t++]) if (map[*s++] != map[*t++])
return ((int) map[(uchar) s[-1]] - return ((int) map[s[-1]] - (int) map[t[-1]]);
(int) map[(uchar) t[-1]]);
} }
return (int) (slen-tlen); return (int) (slen-tlen);
} }
void my_caseup_str_8bit(CHARSET_INFO * cs,char *str) void my_caseup_str_8bit(CHARSET_INFO * cs,char *str)
{ {
register uchar *map=cs->to_upper; register uchar *map=cs->to_upper;
...@@ -53,7 +51,6 @@ void my_caseup_str_8bit(CHARSET_INFO * cs,char *str) ...@@ -53,7 +51,6 @@ void my_caseup_str_8bit(CHARSET_INFO * cs,char *str)
str++; str++;
} }
void my_casedn_str_8bit(CHARSET_INFO * cs,char *str) void my_casedn_str_8bit(CHARSET_INFO * cs,char *str)
{ {
register uchar *map=cs->to_lower; register uchar *map=cs->to_lower;
...@@ -61,7 +58,6 @@ void my_casedn_str_8bit(CHARSET_INFO * cs,char *str) ...@@ -61,7 +58,6 @@ void my_casedn_str_8bit(CHARSET_INFO * cs,char *str)
str++; str++;
} }
void my_caseup_8bit(CHARSET_INFO * cs, char *str, uint length) void my_caseup_8bit(CHARSET_INFO * cs, char *str, uint length)
{ {
register uchar *map=cs->to_upper; register uchar *map=cs->to_upper;
...@@ -76,6 +72,12 @@ void my_casedn_8bit(CHARSET_INFO * cs, char *str, uint length) ...@@ -76,6 +72,12 @@ void my_casedn_8bit(CHARSET_INFO * cs, char *str, uint length)
*str= (char) map[(uchar) *str]; *str= (char) map[(uchar) *str];
} }
void my_tosort_8bit(CHARSET_INFO *cs, char *str, uint length)
{
register uchar *map=cs->sort_order;
for ( ; length>0 ; length--, str++)
*str= (char) map[(uchar) *str];
}
int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t) int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t)
{ {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment