CHARSET_INFO structure reorganization for easier maintainance
This commit is contained in:
parent
f461dea4d7
commit
5aae66c101
@ -97,13 +97,13 @@ bool String::set(longlong num, CHARSET_INFO *cs)
|
|||||||
|
|
||||||
if (alloc(l))
|
if (alloc(l))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (cs->snprintf == my_snprintf_8bit)
|
if (cs->cset->snprintf == my_snprintf_8bit)
|
||||||
{
|
{
|
||||||
str_length=(uint32) (longlong10_to_str(num,Ptr,-10)-Ptr);
|
str_length=(uint32) (longlong10_to_str(num,Ptr,-10)-Ptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str_length=cs->snprintf(cs,Ptr,l,"%d",num);
|
str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num);
|
||||||
}
|
}
|
||||||
str_charset=cs;
|
str_charset=cs;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -115,13 +115,13 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
|
|||||||
|
|
||||||
if (alloc(l))
|
if (alloc(l))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (cs->snprintf == my_snprintf_8bit)
|
if (cs->cset->snprintf == my_snprintf_8bit)
|
||||||
{
|
{
|
||||||
str_length=(uint32) (longlong10_to_str(num,Ptr,10)-Ptr);
|
str_length=(uint32) (longlong10_to_str(num,Ptr,10)-Ptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str_length=cs->snprintf(cs,Ptr,l,"%d",num);
|
str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num);
|
||||||
}
|
}
|
||||||
str_charset=cs;
|
str_charset=cs;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -255,7 +255,7 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *from, CHARSET
|
|||||||
|
|
||||||
for (str_length=new_length ; s < se && d < de ; )
|
for (str_length=new_length ; s < se && d < de ; )
|
||||||
{
|
{
|
||||||
if ((cnvres=from->mb_wc(from,&wc,s,se)) > 0 )
|
if ((cnvres=from->cset->mb_wc(from,&wc,s,se)) > 0 )
|
||||||
{
|
{
|
||||||
s+=cnvres;
|
s+=cnvres;
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *from, CHARSET
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
outp:
|
outp:
|
||||||
if((cnvres=to->wc_mb(to,wc,d,de)) >0 )
|
if((cnvres=to->cset->wc_mb(to,wc,d,de)) >0 )
|
||||||
{
|
{
|
||||||
d+=cnvres;
|
d+=cnvres;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
|
|||||||
}
|
}
|
||||||
if (seg->type == HA_KEYTYPE_TEXT)
|
if (seg->type == HA_KEYTYPE_TEXT)
|
||||||
{
|
{
|
||||||
seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,&nr2);
|
seg->charset->coll->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,&nr2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -250,7 +250,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
|
|||||||
}
|
}
|
||||||
if (seg->type == HA_KEYTYPE_TEXT)
|
if (seg->type == HA_KEYTYPE_TEXT)
|
||||||
{
|
{
|
||||||
seg->charset->hash_sort(seg->charset,pos,end-pos,&nr,&nr2);
|
seg->charset->coll->hash_sort(seg->charset,pos,end-pos,&nr,&nr2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -91,27 +91,11 @@ enum my_lex_states
|
|||||||
MY_LEX_STRING_OR_DELIMITER
|
MY_LEX_STRING_OR_DELIMITER
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct charset_info_st;
|
||||||
|
|
||||||
typedef struct charset_info_st
|
typedef struct my_collation_handler_st
|
||||||
{
|
{
|
||||||
uint number;
|
|
||||||
uint primary_number;
|
|
||||||
uint binary_number;
|
|
||||||
uint state;
|
|
||||||
const char *csname;
|
|
||||||
const char *name;
|
|
||||||
const char *comment;
|
|
||||||
uchar *ctype;
|
|
||||||
uchar *to_lower;
|
|
||||||
uchar *to_upper;
|
|
||||||
uchar *sort_order;
|
|
||||||
uint16 *tab_to_uni;
|
|
||||||
MY_UNI_IDX *tab_from_uni;
|
|
||||||
uchar state_map[256];
|
|
||||||
uchar ident_map[256];
|
|
||||||
|
|
||||||
/* Collation routines */
|
/* Collation routines */
|
||||||
uint strxfrm_multiply;
|
|
||||||
int (*strnncoll)(struct charset_info_st *,
|
int (*strnncoll)(struct charset_info_st *,
|
||||||
const uchar *, uint, const uchar *, uint);
|
const uchar *, uint, const uchar *, uint);
|
||||||
int (*strnncollsp)(struct charset_info_st *,
|
int (*strnncollsp)(struct charset_info_st *,
|
||||||
@ -129,8 +113,20 @@ typedef struct charset_info_st
|
|||||||
const char *wildstr,const char *wildend,
|
const char *wildstr,const char *wildend,
|
||||||
int escape,int w_one, int w_many);
|
int escape,int w_one, int w_many);
|
||||||
|
|
||||||
|
int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
|
||||||
|
|
||||||
|
/* Hash calculation */
|
||||||
|
void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
|
||||||
|
ulong *nr1, ulong *nr2);
|
||||||
|
} MY_COLLATION_HANDLER;
|
||||||
|
|
||||||
|
extern MY_COLLATION_HANDLER my_collation_bin_handler;
|
||||||
|
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct my_charset_handler_st
|
||||||
|
{
|
||||||
/* Multibyte routines */
|
/* Multibyte routines */
|
||||||
uint mbmaxlen;
|
|
||||||
int (*ismbchar)(struct charset_info_st *, const char *, const char *);
|
int (*ismbchar)(struct charset_info_st *, const char *, const char *);
|
||||||
int (*mbcharlen)(struct charset_info_st *, uint);
|
int (*mbcharlen)(struct charset_info_st *, uint);
|
||||||
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
||||||
@ -148,15 +144,6 @@ typedef struct charset_info_st
|
|||||||
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);
|
||||||
|
|
||||||
/* Functions for case comparison */
|
|
||||||
int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
|
|
||||||
|
|
||||||
/* Hash calculation */
|
|
||||||
void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
|
|
||||||
ulong *nr1, ulong *nr2);
|
|
||||||
|
|
||||||
char max_sort_char; /* For LIKE optimization */
|
|
||||||
|
|
||||||
/* Charset dependant snprintf() */
|
/* Charset dependant snprintf() */
|
||||||
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
|
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
|
||||||
...);
|
...);
|
||||||
@ -181,6 +168,35 @@ typedef struct charset_info_st
|
|||||||
|
|
||||||
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
|
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
|
||||||
int sq);
|
int sq);
|
||||||
|
} MY_CHARSET_HANDLER;
|
||||||
|
|
||||||
|
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct charset_info_st
|
||||||
|
{
|
||||||
|
uint number;
|
||||||
|
uint primary_number;
|
||||||
|
uint binary_number;
|
||||||
|
uint state;
|
||||||
|
const char *csname;
|
||||||
|
const char *name;
|
||||||
|
const char *comment;
|
||||||
|
uchar *ctype;
|
||||||
|
uchar *to_lower;
|
||||||
|
uchar *to_upper;
|
||||||
|
uchar *sort_order;
|
||||||
|
uint16 *tab_to_uni;
|
||||||
|
MY_UNI_IDX *tab_from_uni;
|
||||||
|
uchar state_map[256];
|
||||||
|
uchar ident_map[256];
|
||||||
|
uint strxfrm_multiply;
|
||||||
|
uint mbmaxlen;
|
||||||
|
char max_sort_char; /* For LIKE optimization */
|
||||||
|
|
||||||
|
MY_CHARSET_HANDLER *cset;
|
||||||
|
MY_COLLATION_HANDLER *coll;
|
||||||
|
|
||||||
} CHARSET_INFO;
|
} CHARSET_INFO;
|
||||||
|
|
||||||
@ -211,9 +227,6 @@ extern CHARSET_INFO my_charset_utf8_bin;
|
|||||||
extern CHARSET_INFO my_charset_cp1250_czech_ci;
|
extern CHARSET_INFO my_charset_cp1250_czech_ci;
|
||||||
|
|
||||||
|
|
||||||
extern my_bool my_parse_charset_xml(const char *bug, uint len,
|
|
||||||
int (*add)(CHARSET_INFO *cs));
|
|
||||||
|
|
||||||
/* declarations for simple charsets */
|
/* declarations for simple charsets */
|
||||||
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
|
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
|
||||||
uint);
|
uint);
|
||||||
@ -254,7 +267,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
|
|||||||
char **e, int *err);
|
char **e, int *err);
|
||||||
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
|
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
|
||||||
int *err);
|
int *err);
|
||||||
|
|
||||||
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
||||||
long int val);
|
long int val);
|
||||||
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
|
||||||
@ -279,7 +291,6 @@ uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
|
|||||||
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_MB
|
|
||||||
/* Functions for multibyte charsets */
|
/* Functions for multibyte charsets */
|
||||||
extern void my_caseup_str_mb(CHARSET_INFO *, char *);
|
extern void my_caseup_str_mb(CHARSET_INFO *, char *);
|
||||||
extern void my_casedn_str_mb(CHARSET_INFO *, char *);
|
extern void my_casedn_str_mb(CHARSET_INFO *, char *);
|
||||||
@ -294,7 +305,10 @@ int my_wildcmp_mb(CHARSET_INFO *,
|
|||||||
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
|
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||||
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
extern my_bool my_parse_charset_xml(const char *bug, uint len,
|
||||||
|
int (*add)(CHARSET_INFO *cs));
|
||||||
|
|
||||||
|
|
||||||
#define _U 01 /* Upper case */
|
#define _U 01 /* Upper case */
|
||||||
#define _L 02 /* Lower case */
|
#define _L 02 /* Lower case */
|
||||||
@ -329,27 +343,26 @@ uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
|||||||
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
|
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
|
||||||
|
|
||||||
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
|
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
|
||||||
#define my_strnxfrm(s, a, b, c, d) ((s)->strnxfrm((s), (a), (b), (c), (d)))
|
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->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)->coll->strnncoll((s), (a), (b), (c), (d)))
|
||||||
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
|
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
|
||||||
((s)->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
|
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
|
||||||
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
|
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
|
||||||
|
#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b)))
|
||||||
|
|
||||||
#define use_mb(s) ((s)->ismbchar != NULL)
|
#define use_mb(s) ((s)->cset->ismbchar != NULL)
|
||||||
#define my_ismbchar(s, a, b) ((s)->ismbchar((s), (a), (b)))
|
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
|
||||||
#define my_mbcharlen(s, a) ((s)->mbcharlen((s),(a)))
|
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
|
||||||
|
|
||||||
#define my_caseup(s, a, l) ((s)->caseup((s), (a), (l)))
|
#define my_caseup(s, a, l) ((s)->cset->caseup((s), (a), (l)))
|
||||||
#define my_casedn(s, a, l) ((s)->casedn((s), (a), (l)))
|
#define my_casedn(s, a, l) ((s)->cset->casedn((s), (a), (l)))
|
||||||
#define my_caseup_str(s, a) ((s)->caseup_str((s), (a)))
|
#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
|
||||||
#define my_casedn_str(s, a) ((s)->casedn_str((s), (a)))
|
#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
|
||||||
#define my_strcasecmp(s, a, b) ((s)->strcasecmp((s), (a), (b)))
|
#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e)))
|
||||||
|
#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e)))
|
||||||
#define my_strntol(s, a, b, c, d, e) ((s)->strntol((s),(a),(b),(c),(d),(e)))
|
#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e)))
|
||||||
#define my_strntoul(s, a, b, c, d, e) ((s)->strntoul((s),(a),(b),(c),(d),(e)))
|
#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
|
||||||
#define my_strntoll(s, a, b, c, d, e) ((s)->strntoll((s),(a),(b),(c),(d),(e)))
|
#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d)))
|
||||||
#define my_strntoull(s, a, b, c,d, e) ((s)->strntoull((s),(a),(b),(c),(d),(e)))
|
|
||||||
#define my_strntod(s, a, b, c, d) ((s)->strntod((s),(a),(b),(c),(d)))
|
|
||||||
|
|
||||||
|
|
||||||
/* XXX: still need to take care of this one */
|
/* XXX: still need to take care of this one */
|
||||||
|
@ -109,7 +109,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
|
|||||||
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT)
|
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT)
|
||||||
{
|
{
|
||||||
ulong nr=1, nr2=4;
|
ulong nr=1, nr2=4;
|
||||||
keyseg->charset->hash_sort(keyseg->charset,(const uchar*)pos,length,&nr, &nr2);
|
keyseg->charset->coll->hash_sort(keyseg->charset,(const uchar*)pos,length,&nr, &nr2);
|
||||||
crc=nr;
|
crc=nr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -120,45 +120,15 @@ static void simple_cs_init_functions(CHARSET_INFO *cs)
|
|||||||
|
|
||||||
if (cs->state & MY_CS_BINSORT)
|
if (cs->state & MY_CS_BINSORT)
|
||||||
{
|
{
|
||||||
CHARSET_INFO *b= &my_charset_bin;
|
cs->coll= &my_collation_bin_handler;
|
||||||
cs->strnxfrm = b->strnxfrm;
|
|
||||||
cs->like_range = b->like_range;
|
|
||||||
cs->wildcmp = b->wildcmp;
|
|
||||||
cs->strnncoll = b->strnncoll;
|
|
||||||
cs->strnncollsp = b->strnncollsp;
|
|
||||||
cs->strcasecmp = b->strcasecmp;
|
|
||||||
cs->hash_sort = b->hash_sort;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cs->strnxfrm = my_strnxfrm_simple;
|
cs->coll= &my_collation_8bit_simple_ci_handler;
|
||||||
cs->like_range = my_like_range_simple;
|
|
||||||
cs->wildcmp = my_wildcmp_8bit;
|
|
||||||
cs->strnncoll = my_strnncoll_simple;
|
|
||||||
cs->strnncollsp = my_strnncollsp_simple;
|
|
||||||
cs->strcasecmp = my_strcasecmp_8bit;
|
|
||||||
cs->hash_sort = my_hash_sort_simple;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cs->caseup_str = my_caseup_str_8bit;
|
cs->cset= &my_charset_8bit_handler;
|
||||||
cs->casedn_str = my_casedn_str_8bit;
|
|
||||||
cs->caseup = my_caseup_8bit;
|
|
||||||
cs->casedn = my_casedn_8bit;
|
|
||||||
cs->mb_wc = my_mb_wc_8bit;
|
|
||||||
cs->wc_mb = my_wc_mb_8bit;
|
|
||||||
cs->snprintf = my_snprintf_8bit;
|
|
||||||
cs->long10_to_str= my_long10_to_str_8bit;
|
|
||||||
cs->longlong10_to_str= my_longlong10_to_str_8bit;
|
|
||||||
cs->fill = my_fill_8bit;
|
|
||||||
cs->strntol = my_strntol_8bit;
|
|
||||||
cs->strntoul = my_strntoul_8bit;
|
|
||||||
cs->strntoll = my_strntoll_8bit;
|
|
||||||
cs->strntoull = my_strntoull_8bit;
|
|
||||||
cs->strntod = my_strntod_8bit;
|
|
||||||
cs->scan = my_scan_8bit;
|
|
||||||
cs->mbmaxlen = 1;
|
cs->mbmaxlen = 1;
|
||||||
cs->numchars = my_numchars_8bit;
|
|
||||||
cs->charpos = my_charpos_8bit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -329,10 +299,10 @@ static int add_collation(CHARSET_INFO *cs)
|
|||||||
|
|
||||||
if (!(all_charsets[cs->number]->state & MY_CS_COMPILED))
|
if (!(all_charsets[cs->number]->state & MY_CS_COMPILED))
|
||||||
{
|
{
|
||||||
|
simple_cs_init_functions(all_charsets[cs->number]);
|
||||||
simple_cs_copy_data(all_charsets[cs->number],cs);
|
simple_cs_copy_data(all_charsets[cs->number],cs);
|
||||||
if (simple_cs_is_full(all_charsets[cs->number]))
|
if (simple_cs_is_full(all_charsets[cs->number]))
|
||||||
{
|
{
|
||||||
simple_cs_init_functions(all_charsets[cs->number]);
|
|
||||||
all_charsets[cs->number]->state |= MY_CS_LOADED;
|
all_charsets[cs->number]->state |= MY_CS_LOADED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length);
|
|||||||
static uint calc_hash(HASH *hash,const byte *key,uint length)
|
static uint calc_hash(HASH *hash,const byte *key,uint length)
|
||||||
{
|
{
|
||||||
ulong nr1=1, nr2=4;
|
ulong nr1=1, nr2=4;
|
||||||
hash->charset->hash_sort(hash->charset,key,length,&nr1,&nr2);
|
hash->charset->coll->hash_sort(hash->charset,key,length,&nr1,&nr2);
|
||||||
return nr1;
|
return nr1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
57
sql/field.cc
57
sql/field.cc
@ -932,7 +932,7 @@ void Field_decimal::sql_type(String &res) const
|
|||||||
tmp--;
|
tmp--;
|
||||||
if (dec)
|
if (dec)
|
||||||
tmp--;
|
tmp--;
|
||||||
res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
||||||
"decimal(%d,%d)",tmp,dec));
|
"decimal(%d,%d)",tmp,dec));
|
||||||
add_zerofill_and_unsigned(res);
|
add_zerofill_and_unsigned(res);
|
||||||
}
|
}
|
||||||
@ -1100,9 +1100,11 @@ String *Field_tiny::val_str(String *val_buffer,
|
|||||||
char *to=(char*) val_buffer->ptr();
|
char *to=(char*) val_buffer->ptr();
|
||||||
|
|
||||||
if (unsigned_flag)
|
if (unsigned_flag)
|
||||||
length= (uint) cs->long10_to_str(cs,to,mlength, 10,(long) *((uchar*) ptr));
|
length= (uint) cs->cset->long10_to_str(cs,to,mlength, 10,
|
||||||
|
(long) *((uchar*) ptr));
|
||||||
else
|
else
|
||||||
length= (uint) cs->long10_to_str(cs,to,mlength,-10,(long) *((signed char*) ptr));
|
length= (uint) cs->cset->long10_to_str(cs,to,mlength,-10,
|
||||||
|
(long) *((signed char*) ptr));
|
||||||
|
|
||||||
val_buffer->length(length);
|
val_buffer->length(length);
|
||||||
if (zerofill)
|
if (zerofill)
|
||||||
@ -1135,7 +1137,7 @@ void Field_tiny::sort_string(char *to,uint length __attribute__((unused)))
|
|||||||
void Field_tiny::sql_type(String &res) const
|
void Field_tiny::sql_type(String &res) const
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs=res.charset();
|
CHARSET_INFO *cs=res.charset();
|
||||||
res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
||||||
"tinyint(%d)",(int) field_length));
|
"tinyint(%d)",(int) field_length));
|
||||||
add_zerofill_and_unsigned(res);
|
add_zerofill_and_unsigned(res);
|
||||||
}
|
}
|
||||||
@ -1345,9 +1347,10 @@ String *Field_short::val_str(String *val_buffer,
|
|||||||
shortget(j,ptr);
|
shortget(j,ptr);
|
||||||
|
|
||||||
if (unsigned_flag)
|
if (unsigned_flag)
|
||||||
length=(uint) cs->long10_to_str(cs, to, mlength, 10, (long) (uint16) j);
|
length=(uint) cs->cset->long10_to_str(cs, to, mlength, 10,
|
||||||
|
(long) (uint16) j);
|
||||||
else
|
else
|
||||||
length=(uint) cs->long10_to_str(cs, to, mlength,-10, (long) j);
|
length=(uint) cs->cset->long10_to_str(cs, to, mlength,-10, (long) j);
|
||||||
val_buffer->length(length);
|
val_buffer->length(length);
|
||||||
if (zerofill)
|
if (zerofill)
|
||||||
prepend_zeros(val_buffer);
|
prepend_zeros(val_buffer);
|
||||||
@ -1408,7 +1411,7 @@ void Field_short::sort_string(char *to,uint length __attribute__((unused)))
|
|||||||
void Field_short::sql_type(String &res) const
|
void Field_short::sql_type(String &res) const
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs=res.charset();
|
CHARSET_INFO *cs=res.charset();
|
||||||
res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
||||||
"smallint(%d)",(int) field_length));
|
"smallint(%d)",(int) field_length));
|
||||||
add_zerofill_and_unsigned(res);
|
add_zerofill_and_unsigned(res);
|
||||||
}
|
}
|
||||||
@ -1583,7 +1586,7 @@ String *Field_medium::val_str(String *val_buffer,
|
|||||||
char *to=(char*) val_buffer->ptr();
|
char *to=(char*) val_buffer->ptr();
|
||||||
long j= unsigned_flag ? (long) uint3korr(ptr) : sint3korr(ptr);
|
long j= unsigned_flag ? (long) uint3korr(ptr) : sint3korr(ptr);
|
||||||
|
|
||||||
length=(uint) cs->long10_to_str(cs,to,mlength,-10,j);
|
length=(uint) cs->cset->long10_to_str(cs,to,mlength,-10,j);
|
||||||
val_buffer->length(length);
|
val_buffer->length(length);
|
||||||
if (zerofill)
|
if (zerofill)
|
||||||
prepend_zeros(val_buffer); /* purecov: inspected */
|
prepend_zeros(val_buffer); /* purecov: inspected */
|
||||||
@ -1627,7 +1630,7 @@ void Field_medium::sort_string(char *to,uint length __attribute__((unused)))
|
|||||||
void Field_medium::sql_type(String &res) const
|
void Field_medium::sql_type(String &res) const
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs=res.charset();
|
CHARSET_INFO *cs=res.charset();
|
||||||
res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
||||||
"mediumint(%d)",(int) field_length));
|
"mediumint(%d)",(int) field_length));
|
||||||
add_zerofill_and_unsigned(res);
|
add_zerofill_and_unsigned(res);
|
||||||
}
|
}
|
||||||
@ -1643,7 +1646,7 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
|
|||||||
int error= 0;
|
int error= 0;
|
||||||
char *end;
|
char *end;
|
||||||
|
|
||||||
tmp= cs->scan(cs, from, from+len, MY_SEQ_SPACES);
|
tmp= cs->cset->scan(cs, from, from+len, MY_SEQ_SPACES);
|
||||||
len-= tmp;
|
len-= tmp;
|
||||||
from+= tmp;
|
from+= tmp;
|
||||||
my_errno=0;
|
my_errno=0;
|
||||||
@ -1821,9 +1824,9 @@ String *Field_long::val_str(String *val_buffer,
|
|||||||
longget(j,ptr);
|
longget(j,ptr);
|
||||||
|
|
||||||
if (unsigned_flag)
|
if (unsigned_flag)
|
||||||
length=cs->long10_to_str(cs,to,mlength, 10,(long) (uint32)j);
|
length=cs->cset->long10_to_str(cs,to,mlength, 10,(long) (uint32)j);
|
||||||
else
|
else
|
||||||
length=cs->long10_to_str(cs,to,mlength,-10,(long) j);
|
length=cs->cset->long10_to_str(cs,to,mlength,-10,(long) j);
|
||||||
val_buffer->length(length);
|
val_buffer->length(length);
|
||||||
if (zerofill)
|
if (zerofill)
|
||||||
prepend_zeros(val_buffer);
|
prepend_zeros(val_buffer);
|
||||||
@ -1886,7 +1889,7 @@ void Field_long::sort_string(char *to,uint length __attribute__((unused)))
|
|||||||
void Field_long::sql_type(String &res) const
|
void Field_long::sql_type(String &res) const
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs=res.charset();
|
CHARSET_INFO *cs=res.charset();
|
||||||
res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
||||||
"int(%d)",(int) field_length));
|
"int(%d)",(int) field_length));
|
||||||
add_zerofill_and_unsigned(res);
|
add_zerofill_and_unsigned(res);
|
||||||
}
|
}
|
||||||
@ -1901,7 +1904,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
|
|||||||
int error= 0;
|
int error= 0;
|
||||||
char *end;
|
char *end;
|
||||||
|
|
||||||
tmp= cs->scan(cs, from, from+len, MY_SEQ_SPACES);
|
tmp= cs->cset->scan(cs, from, from+len, MY_SEQ_SPACES);
|
||||||
len-= (uint)tmp;
|
len-= (uint)tmp;
|
||||||
from+= tmp;
|
from+= tmp;
|
||||||
my_errno=0;
|
my_errno=0;
|
||||||
@ -2045,7 +2048,7 @@ String *Field_longlong::val_str(String *val_buffer,
|
|||||||
#endif
|
#endif
|
||||||
longlongget(j,ptr);
|
longlongget(j,ptr);
|
||||||
|
|
||||||
length=(uint) (cs->longlong10_to_str)(cs,to,mlength,
|
length=(uint) (cs->cset->longlong10_to_str)(cs,to,mlength,
|
||||||
unsigned_flag ? 10 : -10, j);
|
unsigned_flag ? 10 : -10, j);
|
||||||
val_buffer->length(length);
|
val_buffer->length(length);
|
||||||
if (zerofill)
|
if (zerofill)
|
||||||
@ -2119,7 +2122,7 @@ void Field_longlong::sort_string(char *to,uint length __attribute__((unused)))
|
|||||||
void Field_longlong::sql_type(String &res) const
|
void Field_longlong::sql_type(String &res) const
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs=res.charset();
|
CHARSET_INFO *cs=res.charset();
|
||||||
res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
||||||
"bigint(%d)",(int) field_length));
|
"bigint(%d)",(int) field_length));
|
||||||
add_zerofill_and_unsigned(res);
|
add_zerofill_and_unsigned(res);
|
||||||
}
|
}
|
||||||
@ -2391,7 +2394,7 @@ void Field_float::sql_type(String &res) const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs= res.charset();
|
CHARSET_INFO *cs= res.charset();
|
||||||
res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
||||||
"float(%d,%d)",(int) field_length,dec));
|
"float(%d,%d)",(int) field_length,dec));
|
||||||
}
|
}
|
||||||
add_zerofill_and_unsigned(res);
|
add_zerofill_and_unsigned(res);
|
||||||
@ -2648,7 +2651,7 @@ void Field_double::sql_type(String &res) const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.length(cs->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
||||||
"double(%d,%d)",(int) field_length,dec));
|
"double(%d,%d)",(int) field_length,dec));
|
||||||
}
|
}
|
||||||
add_zerofill_and_unsigned(res);
|
add_zerofill_and_unsigned(res);
|
||||||
@ -3281,7 +3284,7 @@ String *Field_year::val_str(String *val_buffer,
|
|||||||
void Field_year::sql_type(String &res) const
|
void Field_year::sql_type(String &res) const
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs=res.charset();
|
CHARSET_INFO *cs=res.charset();
|
||||||
res.length(cs->snprintf(cs,(char*)res.ptr(),res.alloced_length(),
|
res.length(cs->cset->snprintf(cs,(char*)res.ptr(),res.alloced_length(),
|
||||||
"year(%d)",(int) field_length));
|
"year(%d)",(int) field_length));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3898,7 +3901,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
{
|
{
|
||||||
memcpy(ptr,from,length);
|
memcpy(ptr,from,length);
|
||||||
if (length < field_length)
|
if (length < field_length)
|
||||||
field_charset->fill(field_charset,ptr+length,field_length-length,' ');
|
field_charset->cset->fill(field_charset,ptr+length,field_length-length,' ');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3907,7 +3910,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
{ // Check if we loosed some info
|
{ // Check if we loosed some info
|
||||||
const char *end=from+length;
|
const char *end=from+length;
|
||||||
from+= field_length;
|
from+= field_length;
|
||||||
from+= field_charset->scan(field_charset, from, end, MY_SEQ_SPACES);
|
from+= field_charset->cset->scan(field_charset, from, end, MY_SEQ_SPACES);
|
||||||
if (from != end)
|
if (from != end)
|
||||||
{
|
{
|
||||||
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);
|
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);
|
||||||
@ -3934,7 +3937,7 @@ int Field_string::store(longlong nr)
|
|||||||
char buff[64];
|
char buff[64];
|
||||||
int l;
|
int l;
|
||||||
CHARSET_INFO *cs=charset();
|
CHARSET_INFO *cs=charset();
|
||||||
l= (cs->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr);
|
l= (cs->cset->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr);
|
||||||
return Field_string::store(buff,(uint)l,cs);
|
return Field_string::store(buff,(uint)l,cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3977,11 +3980,11 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)
|
|||||||
We have to remove end space to be able to compare multi-byte-characters
|
We have to remove end space to be able to compare multi-byte-characters
|
||||||
like in latin_de 'ae' and 0xe4
|
like in latin_de 'ae' and 0xe4
|
||||||
*/
|
*/
|
||||||
return field_charset->strnncollsp(field_charset,
|
return field_charset->coll->strnncollsp(field_charset,
|
||||||
(const uchar*) a_ptr, field_length,
|
(const uchar*) a_ptr, field_length,
|
||||||
(const uchar*) b_ptr, field_length);
|
(const uchar*) b_ptr, field_length);
|
||||||
}
|
}
|
||||||
return field_charset->strnncoll(field_charset,
|
return field_charset->coll->strnncoll(field_charset,
|
||||||
(const uchar*) a_ptr, field_length,
|
(const uchar*) a_ptr, field_length,
|
||||||
(const uchar*) b_ptr, field_length);
|
(const uchar*) b_ptr, field_length);
|
||||||
}
|
}
|
||||||
@ -3999,7 +4002,7 @@ void Field_string::sort_string(char *to,uint length)
|
|||||||
void Field_string::sql_type(String &res) const
|
void Field_string::sql_type(String &res) const
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs=res.charset();
|
CHARSET_INFO *cs=res.charset();
|
||||||
ulong length= cs->snprintf(cs,(char*) res.ptr(),
|
ulong length= cs->cset->snprintf(cs,(char*) res.ptr(),
|
||||||
res.alloced_length(), "%s(%d)",
|
res.alloced_length(), "%s(%d)",
|
||||||
(field_length > 3 &&
|
(field_length > 3 &&
|
||||||
(table->db_options_in_use &
|
(table->db_options_in_use &
|
||||||
@ -4112,7 +4115,7 @@ int Field_varstring::store(longlong nr)
|
|||||||
char buff[64];
|
char buff[64];
|
||||||
int l;
|
int l;
|
||||||
CHARSET_INFO *cs=charset();
|
CHARSET_INFO *cs=charset();
|
||||||
l= (cs->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr);
|
l= (cs->cset->longlong10_to_str)(cs,buff,sizeof(buff),-10,nr);
|
||||||
return Field_varstring::store(buff,(uint)l,cs);
|
return Field_varstring::store(buff,(uint)l,cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4169,7 +4172,7 @@ void Field_varstring::sort_string(char *to,uint length)
|
|||||||
void Field_varstring::sql_type(String &res) const
|
void Field_varstring::sql_type(String &res) const
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs=res.charset();
|
CHARSET_INFO *cs=res.charset();
|
||||||
ulong length= cs->snprintf(cs,(char*) res.ptr(),
|
ulong length= cs->cset->snprintf(cs,(char*) res.ptr(),
|
||||||
res.alloced_length(),"varchar(%u)",
|
res.alloced_length(),"varchar(%u)",
|
||||||
field_length);
|
field_length);
|
||||||
res.length(length);
|
res.length(length);
|
||||||
|
@ -788,7 +788,7 @@ public:
|
|||||||
enum ha_base_keytype key_type() const
|
enum ha_base_keytype key_type() const
|
||||||
{ return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; }
|
{ return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; }
|
||||||
bool zero_pack() const { return 0; }
|
bool zero_pack() const { return 0; }
|
||||||
void reset(void) { charset()->fill(charset(),ptr,field_length,' '); }
|
void reset(void) { charset()->cset->fill(charset(),ptr,field_length,' '); }
|
||||||
int store(const char *to,uint length,CHARSET_INFO *charset);
|
int store(const char *to,uint length,CHARSET_INFO *charset);
|
||||||
int store(double nr);
|
int store(double nr);
|
||||||
int store(longlong nr);
|
int store(longlong nr);
|
||||||
|
@ -1491,7 +1491,7 @@ bool Item_func_in::nulls_in_row()
|
|||||||
static int srtcmp_in(const String *x,const String *y)
|
static int srtcmp_in(const String *x,const String *y)
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs= x->charset();
|
CHARSET_INFO *cs= x->charset();
|
||||||
return cs->strnncollsp(cs,
|
return cs->coll->strnncollsp(cs,
|
||||||
(unsigned char *) x->ptr(),x->length(),
|
(unsigned char *) x->ptr(),x->length(),
|
||||||
(unsigned char *) y->ptr(),y->length());
|
(unsigned char *) y->ptr(),y->length());
|
||||||
}
|
}
|
||||||
@ -1499,7 +1499,7 @@ static int srtcmp_in(const String *x,const String *y)
|
|||||||
static int bincmp_in(const String *x,const String *y)
|
static int bincmp_in(const String *x,const String *y)
|
||||||
{
|
{
|
||||||
CHARSET_INFO *cs= &my_charset_bin;
|
CHARSET_INFO *cs= &my_charset_bin;
|
||||||
return cs->strnncollsp(cs,
|
return cs->coll->strnncollsp(cs,
|
||||||
(unsigned char *) x->ptr(),x->length(),
|
(unsigned char *) x->ptr(),x->length(),
|
||||||
(unsigned char *) y->ptr(),y->length());
|
(unsigned char *) y->ptr(),y->length());
|
||||||
}
|
}
|
||||||
|
@ -1489,7 +1489,7 @@ String *Item_func_user::val_str(String *str)
|
|||||||
null_value=1;
|
null_value=1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
res_length=cs->snprintf(cs, (char*)str->ptr(), res_length, "%s@%s",
|
res_length=cs->cset->snprintf(cs, (char*)str->ptr(), res_length, "%s@%s",
|
||||||
thd->user, host);
|
thd->user, host);
|
||||||
str->length(res_length);
|
str->length(res_length);
|
||||||
str->set_charset(cs);
|
str->set_charset(cs);
|
||||||
@ -2133,7 +2133,7 @@ String *Item_func_conv_charset3::val_str(String *str)
|
|||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
cnvres=from_charset->mb_wc(from_charset,&wc,s,se);
|
cnvres=from_charset->cset->mb_wc(from_charset,&wc,s,se);
|
||||||
if (cnvres>0)
|
if (cnvres>0)
|
||||||
{
|
{
|
||||||
s+=cnvres;
|
s+=cnvres;
|
||||||
@ -2147,7 +2147,7 @@ String *Item_func_conv_charset3::val_str(String *str)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
outp:
|
outp:
|
||||||
cnvres=to_charset->wc_mb(to_charset,wc,d,de);
|
cnvres=to_charset->cset->wc_mb(to_charset,wc,d,de);
|
||||||
if (cnvres>0)
|
if (cnvres>0)
|
||||||
{
|
{
|
||||||
d+=cnvres;
|
d+=cnvres;
|
||||||
|
@ -511,7 +511,7 @@ void Item_func_curtime::fix_length_and_dec()
|
|||||||
(ulong) (((uint) start->tm_min)*100L+
|
(ulong) (((uint) start->tm_min)*100L+
|
||||||
(uint) start->tm_sec));
|
(uint) start->tm_sec));
|
||||||
|
|
||||||
buff_length=cs->snprintf(cs,buff,sizeof(buff),"%02d:%02d:%02d",
|
buff_length=cs->cset->snprintf(cs,buff,sizeof(buff),"%02d:%02d:%02d",
|
||||||
(int) start->tm_hour,
|
(int) start->tm_hour,
|
||||||
(int) start->tm_min,
|
(int) start->tm_min,
|
||||||
(int) start->tm_sec);
|
(int) start->tm_sec);
|
||||||
@ -543,7 +543,7 @@ void Item_func_now::fix_length_and_dec()
|
|||||||
(ulong) (((uint) start->tm_min)*100L+
|
(ulong) (((uint) start->tm_min)*100L+
|
||||||
(uint) start->tm_sec)));
|
(uint) start->tm_sec)));
|
||||||
|
|
||||||
buff_length= (uint) cs->snprintf(cs,buff, sizeof(buff),
|
buff_length= (uint) cs->cset->snprintf(cs,buff, sizeof(buff),
|
||||||
"%04d-%02d-%02d %02d:%02d:%02d",
|
"%04d-%02d-%02d %02d:%02d:%02d",
|
||||||
((int) (start->tm_year+1900)) % 10000,
|
((int) (start->tm_year+1900)) % 10000,
|
||||||
(int) start->tm_mon+1,
|
(int) start->tm_mon+1,
|
||||||
@ -950,7 +950,7 @@ String *Item_func_from_unixtime::val_str(String *str)
|
|||||||
l=20*cs->mbmaxlen+32;
|
l=20*cs->mbmaxlen+32;
|
||||||
if (str->alloc(l))
|
if (str->alloc(l))
|
||||||
return str; /* purecov: inspected */
|
return str; /* purecov: inspected */
|
||||||
l=cs->snprintf(cs,(char*) str->ptr(),l,"%04d-%02d-%02d %02d:%02d:%02d",
|
l=cs->cset->snprintf(cs,(char*) str->ptr(),l,"%04d-%02d-%02d %02d:%02d:%02d",
|
||||||
(int) start->tm_year+1900,
|
(int) start->tm_year+1900,
|
||||||
(int) start->tm_mon+1,
|
(int) start->tm_mon+1,
|
||||||
(int) start->tm_mday,
|
(int) start->tm_mday,
|
||||||
@ -1134,7 +1134,7 @@ String *Item_date_add_interval::val_str(String *str)
|
|||||||
l=11*cs->mbmaxlen+32;
|
l=11*cs->mbmaxlen+32;
|
||||||
if (str->alloc(l))
|
if (str->alloc(l))
|
||||||
goto null_date;
|
goto null_date;
|
||||||
l=cs->snprintf(cs,(char*) str->ptr(),l,"%04d-%02d-%02d",
|
l=cs->cset->snprintf(cs,(char*) str->ptr(),l,"%04d-%02d-%02d",
|
||||||
ltime.year,ltime.month,ltime.day);
|
ltime.year,ltime.month,ltime.day);
|
||||||
str->length(l);
|
str->length(l);
|
||||||
}
|
}
|
||||||
@ -1143,7 +1143,7 @@ String *Item_date_add_interval::val_str(String *str)
|
|||||||
l=20*cs->mbmaxlen+32;
|
l=20*cs->mbmaxlen+32;
|
||||||
if (str->alloc(l))
|
if (str->alloc(l))
|
||||||
goto null_date;
|
goto null_date;
|
||||||
l=cs->snprintf(cs,(char*) str->ptr(),l,"%04d-%02d-%02d %02d:%02d:%02d",
|
l=cs->cset->snprintf(cs,(char*) str->ptr(),l,"%04d-%02d-%02d %02d:%02d:%02d",
|
||||||
ltime.year,ltime.month,ltime.day,
|
ltime.year,ltime.month,ltime.day,
|
||||||
ltime.hour,ltime.minute,ltime.second);
|
ltime.hour,ltime.minute,ltime.second);
|
||||||
str->length(l);
|
str->length(l);
|
||||||
|
@ -101,7 +101,7 @@ bool String::set(longlong num, CHARSET_INFO *cs)
|
|||||||
|
|
||||||
if (alloc(l))
|
if (alloc(l))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
str_length=(uint32) (cs->longlong10_to_str)(cs,Ptr,l,-10,num);
|
str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,-10,num);
|
||||||
str_charset=cs;
|
str_charset=cs;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
|
|||||||
|
|
||||||
if (alloc(l))
|
if (alloc(l))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
str_length=(uint32) (cs->longlong10_to_str)(cs,Ptr,l,10,num);
|
str_length=(uint32) (cs->cset->longlong10_to_str)(cs,Ptr,l,10,num);
|
||||||
str_charset=cs;
|
str_charset=cs;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -396,13 +396,13 @@ bool String::append(IO_CACHE* file, uint32 arg_length)
|
|||||||
|
|
||||||
uint32 String::numchars()
|
uint32 String::numchars()
|
||||||
{
|
{
|
||||||
return str_charset->numchars(str_charset, Ptr, Ptr+str_length);
|
return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
int String::charpos(int i,uint32 offset)
|
int String::charpos(int i,uint32 offset)
|
||||||
{
|
{
|
||||||
if (i<0) return i;
|
if (i<0) return i;
|
||||||
return str_charset->charpos(str_charset,Ptr+offset,Ptr+str_length,i);
|
return str_charset->cset->charpos(str_charset,Ptr+offset,Ptr+str_length,i);
|
||||||
}
|
}
|
||||||
|
|
||||||
int String::strstr(const String &s,uint32 offset)
|
int String::strstr(const String &s,uint32 offset)
|
||||||
@ -580,7 +580,7 @@ void String::qs_append(const char &c)
|
|||||||
|
|
||||||
int sortcmp(const String *x,const String *y, CHARSET_INFO *cs)
|
int sortcmp(const String *x,const String *y, CHARSET_INFO *cs)
|
||||||
{
|
{
|
||||||
return cs->strnncollsp(cs,
|
return cs->coll->strnncollsp(cs,
|
||||||
(unsigned char *) x->ptr(),x->length(),
|
(unsigned char *) x->ptr(),x->length(),
|
||||||
(unsigned char *) y->ptr(),y->length());
|
(unsigned char *) y->ptr(),y->length());
|
||||||
}
|
}
|
||||||
@ -639,7 +639,7 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
|||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if ((cnvres=from_cs->mb_wc(from_cs, &wc, (uchar*) from, from_end)) > 0)
|
if ((cnvres=from_cs->cset->mb_wc(from_cs, &wc, (uchar*) from, from_end)) > 0)
|
||||||
from+= cnvres;
|
from+= cnvres;
|
||||||
else if (cnvres == MY_CS_ILSEQ)
|
else if (cnvres == MY_CS_ILSEQ)
|
||||||
{
|
{
|
||||||
@ -650,7 +650,7 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
|||||||
break; // Impossible char.
|
break; // Impossible char.
|
||||||
|
|
||||||
outp:
|
outp:
|
||||||
if ((cnvres= to_cs->wc_mb(to_cs, wc, (uchar*) to, to_end)) > 0)
|
if ((cnvres= to_cs->cset->wc_mb(to_cs, wc, (uchar*) to, to_end)) > 0)
|
||||||
to+= cnvres;
|
to+= cnvres;
|
||||||
else if (cnvres == MY_CS_ILUNI && wc != '?')
|
else if (cnvres == MY_CS_ILUNI && wc != '?')
|
||||||
{
|
{
|
||||||
|
@ -6226,6 +6226,42 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_big5_chinese_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_big5,
|
||||||
|
my_strnncollsp_big5,
|
||||||
|
my_strnxfrm_big5,
|
||||||
|
my_like_range_big5,
|
||||||
|
my_wildcmp_mb,
|
||||||
|
my_strcasecmp_mb,
|
||||||
|
my_hash_sort_simple
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_big5_handler=
|
||||||
|
{
|
||||||
|
ismbchar_big5,
|
||||||
|
mbcharlen_big5,
|
||||||
|
my_numchars_mb,
|
||||||
|
my_charpos_mb,
|
||||||
|
my_mb_wc_big5, /* mb_wc */
|
||||||
|
my_wc_mb_big5, /* wc_mb */
|
||||||
|
my_caseup_str_mb,
|
||||||
|
my_casedn_str_mb,
|
||||||
|
my_caseup_mb,
|
||||||
|
my_casedn_mb,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
CHARSET_INFO my_charset_big5_chinese_ci =
|
CHARSET_INFO my_charset_big5_chinese_ci =
|
||||||
{
|
{
|
||||||
1,0,0, /* number */
|
1,0,0, /* number */
|
||||||
@ -6241,37 +6277,12 @@ CHARSET_INFO my_charset_big5_chinese_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_big5,
|
|
||||||
my_strnncollsp_big5,
|
|
||||||
my_strnxfrm_big5,
|
|
||||||
my_like_range_big5,
|
|
||||||
my_wildcmp_mb,
|
|
||||||
2, /* mbmaxlen */
|
2, /* mbmaxlen */
|
||||||
ismbchar_big5,
|
|
||||||
mbcharlen_big5,
|
|
||||||
my_numchars_mb,
|
|
||||||
my_charpos_mb,
|
|
||||||
my_mb_wc_big5, /* mb_wc */
|
|
||||||
my_wc_mb_big5, /* wc_mb */
|
|
||||||
my_caseup_str_mb,
|
|
||||||
my_casedn_str_mb,
|
|
||||||
my_caseup_mb,
|
|
||||||
my_casedn_mb,
|
|
||||||
my_strcasecmp_mb,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_big5_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_big5_chinese_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -262,6 +262,42 @@ static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MY_COLLATION_HANDLER my_collation_bin_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_binary,
|
||||||
|
my_strnncollsp_binary,
|
||||||
|
my_strnxfrm_bin,
|
||||||
|
my_like_range_simple,
|
||||||
|
my_wildcmp_bin,
|
||||||
|
my_strcasecmp_bin,
|
||||||
|
my_hash_sort_bin
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
NULL, /* ismbchar */
|
||||||
|
NULL, /* mbcharlen */
|
||||||
|
my_numchars_8bit,
|
||||||
|
my_charpos_8bit,
|
||||||
|
my_mb_wc_bin,
|
||||||
|
my_wc_mb_bin,
|
||||||
|
my_caseup_str_bin,
|
||||||
|
my_casedn_str_bin,
|
||||||
|
my_caseup_bin,
|
||||||
|
my_casedn_bin,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
CHARSET_INFO my_charset_bin =
|
CHARSET_INFO my_charset_bin =
|
||||||
{
|
{
|
||||||
63,0,0, /* number */
|
63,0,0, /* number */
|
||||||
@ -277,33 +313,8 @@ CHARSET_INFO my_charset_bin =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_binary, /* strnncoll */
|
|
||||||
my_strnncollsp_binary,
|
|
||||||
my_strnxfrm_bin, /* strxnfrm */
|
|
||||||
my_like_range_simple, /* like_range */
|
|
||||||
my_wildcmp_bin, /* wildcmp */
|
|
||||||
1, /* mbmaxlen */
|
1, /* mbmaxlen */
|
||||||
NULL, /* ismbchar */
|
|
||||||
NULL, /* mbcharlen */
|
|
||||||
my_numchars_8bit,
|
|
||||||
my_charpos_8bit,
|
|
||||||
my_mb_wc_bin, /* mb_wc */
|
|
||||||
my_wc_mb_bin, /* wc_mb */
|
|
||||||
my_caseup_str_bin, /* caseup_str */
|
|
||||||
my_casedn_str_bin, /* casedn_str */
|
|
||||||
my_caseup_bin, /* caseup */
|
|
||||||
my_casedn_bin, /* casedn */
|
|
||||||
my_strcasecmp_bin, /* strcasecmp */
|
|
||||||
my_hash_sort_bin, /* hash_sort */
|
|
||||||
(char) 255, /* max_sort_char */
|
(char) 255, /* max_sort_char */
|
||||||
my_snprintf_8bit, /* snprintf */
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_bin_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
@ -604,6 +604,16 @@ int my_strnncollsp_czech(CHARSET_INFO * cs,
|
|||||||
return my_strnncoll_czech(cs,s,slen,t,tlen);
|
return my_strnncoll_czech(cs,s,slen,t,tlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_latin2_czech_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_czech,
|
||||||
|
my_strnncollsp_czech,
|
||||||
|
my_strnxfrm_czech,
|
||||||
|
my_like_range_czech,
|
||||||
|
my_wildcmp_8bit,
|
||||||
|
my_strcasecmp_8bit,
|
||||||
|
my_hash_sort_simple,
|
||||||
|
};
|
||||||
|
|
||||||
CHARSET_INFO my_charset_latin2_czech_ci =
|
CHARSET_INFO my_charset_latin2_czech_ci =
|
||||||
{
|
{
|
||||||
@ -620,37 +630,13 @@ CHARSET_INFO my_charset_latin2_czech_ci =
|
|||||||
idx_uni_8859_2, /* tab_from_uni */
|
idx_uni_8859_2, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
4, /* strxfrm_multiply */
|
4, /* strxfrm_multiply */
|
||||||
my_strnncoll_czech,
|
|
||||||
my_strnncollsp_czech,
|
|
||||||
my_strnxfrm_czech,
|
|
||||||
my_like_range_czech,
|
|
||||||
my_wildcmp_8bit,
|
|
||||||
1, /* mbmaxlen */
|
1, /* mbmaxlen */
|
||||||
NULL, /* ismbchar */
|
|
||||||
NULL, /* mbcharlen */
|
|
||||||
my_numchars_8bit,
|
|
||||||
my_charpos_8bit,
|
|
||||||
my_mb_wc_8bit, /* mb_wc */
|
|
||||||
my_wc_mb_8bit, /* wc_mb */
|
|
||||||
my_caseup_str_8bit,
|
|
||||||
my_casedn_str_8bit,
|
|
||||||
my_caseup_8bit,
|
|
||||||
my_casedn_8bit,
|
|
||||||
my_strcasecmp_8bit,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_8bit_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_latin2_czech_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -8634,6 +8634,43 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_simple,/* strnncoll */
|
||||||
|
my_strnncollsp_simple,
|
||||||
|
my_strnxfrm_simple, /* strnxfrm */
|
||||||
|
my_like_range_simple,/* like_range */
|
||||||
|
my_wildcmp_mb, /* wildcmp */
|
||||||
|
my_strcasecmp_mb,
|
||||||
|
my_hash_sort_simple,
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
ismbchar_euc_kr,
|
||||||
|
mbcharlen_euc_kr,
|
||||||
|
my_numchars_mb,
|
||||||
|
my_charpos_mb,
|
||||||
|
my_mb_wc_euc_kr, /* mb_wc */
|
||||||
|
my_wc_mb_euc_kr, /* wc_mb */
|
||||||
|
my_caseup_str_mb,
|
||||||
|
my_casedn_str_mb,
|
||||||
|
my_caseup_mb,
|
||||||
|
my_casedn_mb,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_euckr_korean_ci =
|
CHARSET_INFO my_charset_euckr_korean_ci =
|
||||||
{
|
{
|
||||||
19,0,0, /* number */
|
19,0,0, /* number */
|
||||||
@ -8649,35 +8686,10 @@ CHARSET_INFO my_charset_euckr_korean_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
|
||||||
my_strnncollsp_simple,
|
|
||||||
my_strnxfrm_simple, /* strnxfrm */
|
|
||||||
my_like_range_simple,/* like_range */
|
|
||||||
my_wildcmp_mb, /* wildcmp */
|
|
||||||
2, /* mbmaxlen */
|
2, /* mbmaxlen */
|
||||||
ismbchar_euc_kr,
|
|
||||||
mbcharlen_euc_kr,
|
|
||||||
my_numchars_mb,
|
|
||||||
my_charpos_mb,
|
|
||||||
my_mb_wc_euc_kr, /* mb_wc */
|
|
||||||
my_wc_mb_euc_kr, /* wc_mb */
|
|
||||||
my_caseup_str_mb,
|
|
||||||
my_casedn_str_mb,
|
|
||||||
my_caseup_mb,
|
|
||||||
my_casedn_mb,
|
|
||||||
my_strcasecmp_mb,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,35 +32,9 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
0,
|
0,
|
||||||
NULL, /* strnncoll */
|
|
||||||
NULL, /* strnncollsp */
|
|
||||||
NULL, /* strnxfrm */
|
|
||||||
NULL, /* like_range */
|
|
||||||
NULL, /* wildcmp */
|
|
||||||
0,
|
0,
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL, /* mb_wc */
|
|
||||||
NULL, /* wc_mb */
|
|
||||||
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL, /* hash_sort */
|
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL
|
NULL
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -5684,6 +5684,43 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_simple,/* strnncoll */
|
||||||
|
my_strnncollsp_simple,
|
||||||
|
my_strnxfrm_simple, /* strnxfrm */
|
||||||
|
my_like_range_simple,/* like_range */
|
||||||
|
my_wildcmp_mb, /* wildcmp */
|
||||||
|
my_strcasecmp_mb,
|
||||||
|
my_hash_sort_simple,
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
ismbchar_gb2312,
|
||||||
|
mbcharlen_gb2312,
|
||||||
|
my_numchars_mb,
|
||||||
|
my_charpos_mb,
|
||||||
|
my_mb_wc_gb2312, /* mb_wc */
|
||||||
|
my_wc_mb_gb2312, /* wc_mb */
|
||||||
|
my_caseup_str_mb,
|
||||||
|
my_casedn_str_mb,
|
||||||
|
my_caseup_mb,
|
||||||
|
my_casedn_mb,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_gb2312_chinese_ci =
|
CHARSET_INFO my_charset_gb2312_chinese_ci =
|
||||||
{
|
{
|
||||||
24,0,0, /* number */
|
24,0,0, /* number */
|
||||||
@ -5699,35 +5736,10 @@ CHARSET_INFO my_charset_gb2312_chinese_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
|
||||||
my_strnncollsp_simple,
|
|
||||||
my_strnxfrm_simple, /* strnxfrm */
|
|
||||||
my_like_range_simple,/* like_range */
|
|
||||||
my_wildcmp_mb, /* wildcmp */
|
|
||||||
2, /* mbmaxlen */
|
2, /* mbmaxlen */
|
||||||
ismbchar_gb2312,
|
|
||||||
mbcharlen_gb2312,
|
|
||||||
my_numchars_mb,
|
|
||||||
my_charpos_mb,
|
|
||||||
my_mb_wc_gb2312, /* mb_wc */
|
|
||||||
my_wc_mb_gb2312, /* wc_mb */
|
|
||||||
my_caseup_str_mb,
|
|
||||||
my_casedn_str_mb,
|
|
||||||
my_caseup_mb,
|
|
||||||
my_casedn_mb,
|
|
||||||
my_strcasecmp_mb,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -9881,6 +9881,43 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_gbk,
|
||||||
|
my_strnncollsp_gbk,
|
||||||
|
my_strnxfrm_gbk,
|
||||||
|
my_like_range_gbk,
|
||||||
|
my_wildcmp_mb,
|
||||||
|
my_strcasecmp_mb,
|
||||||
|
my_hash_sort_simple,
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
ismbchar_gbk,
|
||||||
|
mbcharlen_gbk,
|
||||||
|
my_numchars_mb,
|
||||||
|
my_charpos_mb,
|
||||||
|
my_mb_wc_gbk,
|
||||||
|
my_wc_mb_gbk,
|
||||||
|
my_caseup_str_mb,
|
||||||
|
my_casedn_str_mb,
|
||||||
|
my_caseup_mb,
|
||||||
|
my_casedn_mb,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_gbk_chinese_ci =
|
CHARSET_INFO my_charset_gbk_chinese_ci =
|
||||||
{
|
{
|
||||||
28,0,0, /* number */
|
28,0,0, /* number */
|
||||||
@ -9896,35 +9933,10 @@ CHARSET_INFO my_charset_gbk_chinese_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_gbk,
|
|
||||||
my_strnncollsp_gbk,
|
|
||||||
my_strnxfrm_gbk,
|
|
||||||
my_like_range_gbk,
|
|
||||||
my_wildcmp_mb, /* wildcmp */
|
|
||||||
2, /* mbmaxlen */
|
2, /* mbmaxlen */
|
||||||
ismbchar_gbk,
|
|
||||||
mbcharlen_gbk,
|
|
||||||
my_numchars_mb,
|
|
||||||
my_charpos_mb,
|
|
||||||
my_mb_wc_gbk, /* mb_wc */
|
|
||||||
my_wc_mb_gbk, /* wc_mb */
|
|
||||||
my_caseup_str_mb,
|
|
||||||
my_casedn_str_mb,
|
|
||||||
my_caseup_mb,
|
|
||||||
my_casedn_mb,
|
|
||||||
my_strcasecmp_mb,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -174,6 +174,30 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
return ((wc < 256) && ((str[0]=uni_latin1[wc]) || (!wc))) ? 1 : MY_CS_ILUNI;
|
return ((wc < 256) && ((str[0]=uni_latin1[wc]) || (!wc))) ? 1 : MY_CS_ILUNI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
my_numchars_8bit,
|
||||||
|
my_charpos_8bit,
|
||||||
|
my_mb_wc_latin1,
|
||||||
|
my_wc_mb_latin1,
|
||||||
|
my_caseup_str_8bit,
|
||||||
|
my_casedn_str_8bit,
|
||||||
|
my_caseup_8bit,
|
||||||
|
my_casedn_8bit,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_latin1 =
|
CHARSET_INFO my_charset_latin1 =
|
||||||
{
|
{
|
||||||
@ -190,35 +214,10 @@ CHARSET_INFO my_charset_latin1 =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,
|
|
||||||
my_strnncollsp_simple,
|
|
||||||
my_strnxfrm_simple,
|
|
||||||
my_like_range_simple,
|
|
||||||
my_wildcmp_8bit, /* wildcmp */
|
|
||||||
1, /* mbmaxlen */
|
1, /* mbmaxlen */
|
||||||
NULL, /* ismbchar */
|
|
||||||
NULL, /* mbcharlen */
|
|
||||||
my_numchars_8bit,
|
|
||||||
my_charpos_8bit,
|
|
||||||
my_mb_wc_latin1, /* mb_wc */
|
|
||||||
my_wc_mb_latin1, /* wc_mb */
|
|
||||||
my_caseup_str_8bit,
|
|
||||||
my_casedn_str_8bit,
|
|
||||||
my_caseup_8bit,
|
|
||||||
my_casedn_8bit,
|
|
||||||
my_strcasecmp_8bit,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_8bit_simple_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -428,6 +427,19 @@ static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
return dest - dest_orig;
|
return dest - dest_orig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_german2_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_latin1_de,
|
||||||
|
my_strnncollsp_latin1_de,
|
||||||
|
my_strnxfrm_latin1_de,
|
||||||
|
my_like_range_simple,
|
||||||
|
my_wildcmp_8bit,
|
||||||
|
my_strcasecmp_8bit,
|
||||||
|
my_hash_sort_simple
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_latin1_german2_ci =
|
CHARSET_INFO my_charset_latin1_german2_ci =
|
||||||
{
|
{
|
||||||
31,0,0, /* number */
|
31,0,0, /* number */
|
||||||
@ -443,34 +455,9 @@ CHARSET_INFO my_charset_latin1_german2_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
2, /* strxfrm_multiply */
|
2, /* strxfrm_multiply */
|
||||||
my_strnncoll_latin1_de,
|
|
||||||
my_strnncollsp_latin1_de,
|
|
||||||
my_strnxfrm_latin1_de,
|
|
||||||
my_like_range_simple,
|
|
||||||
my_wildcmp_8bit, /* wildcmp */
|
|
||||||
1, /* mbmaxlen */
|
1, /* mbmaxlen */
|
||||||
NULL, /* ismbchar */
|
|
||||||
NULL, /* mbcharlen */
|
|
||||||
my_numchars_8bit,
|
|
||||||
my_charpos_8bit,
|
|
||||||
my_mb_wc_latin1, /* mb_wc */
|
|
||||||
my_wc_mb_latin1, /* wc_mb */
|
|
||||||
my_caseup_str_8bit,
|
|
||||||
my_casedn_str_8bit,
|
|
||||||
my_caseup_8bit,
|
|
||||||
my_casedn_8bit,
|
|
||||||
my_strcasecmp_8bit,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_german2_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1019,3 +1019,38 @@ uint my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
{
|
{
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MY_CHARSET_HANDLER my_charset_8bit_handler=
|
||||||
|
{
|
||||||
|
NULL, /* ismbchar */
|
||||||
|
NULL, /* mbcharlen */
|
||||||
|
my_numchars_8bit,
|
||||||
|
my_charpos_8bit,
|
||||||
|
my_mb_wc_8bit,
|
||||||
|
my_wc_mb_8bit,
|
||||||
|
my_caseup_str_8bit,
|
||||||
|
my_casedn_str_8bit,
|
||||||
|
my_caseup_8bit,
|
||||||
|
my_casedn_8bit,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_simple,
|
||||||
|
my_strnncollsp_simple,
|
||||||
|
my_strnxfrm_simple,
|
||||||
|
my_like_range_simple,
|
||||||
|
my_wildcmp_8bit,
|
||||||
|
my_strcasecmp_8bit,
|
||||||
|
my_hash_sort_simple
|
||||||
|
};
|
||||||
|
@ -4468,6 +4468,43 @@ my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_sjis,
|
||||||
|
my_strnncollsp_sjis,
|
||||||
|
my_strnxfrm_sjis,
|
||||||
|
my_like_range_sjis,
|
||||||
|
my_wildcmp_mb, /* wildcmp */
|
||||||
|
my_strcasecmp_8bit,
|
||||||
|
my_hash_sort_simple,
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
ismbchar_sjis,
|
||||||
|
mbcharlen_sjis,
|
||||||
|
my_numchars_mb,
|
||||||
|
my_charpos_mb,
|
||||||
|
my_mb_wc_sjis, /* mb_wc */
|
||||||
|
my_wc_mb_sjis, /* wc_mb */
|
||||||
|
my_caseup_str_8bit,
|
||||||
|
my_casedn_str_8bit,
|
||||||
|
my_caseup_8bit,
|
||||||
|
my_casedn_8bit,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_sjis_japanese_ci =
|
CHARSET_INFO my_charset_sjis_japanese_ci =
|
||||||
{
|
{
|
||||||
13,0,0, /* number */
|
13,0,0, /* number */
|
||||||
@ -4483,35 +4520,11 @@ CHARSET_INFO my_charset_sjis_japanese_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_sjis,
|
|
||||||
my_strnncollsp_sjis,
|
|
||||||
my_strnxfrm_sjis,
|
|
||||||
my_like_range_sjis,
|
|
||||||
my_wildcmp_mb, /* wildcmp */
|
|
||||||
2, /* mbmaxlen */
|
2, /* mbmaxlen */
|
||||||
ismbchar_sjis,
|
|
||||||
mbcharlen_sjis,
|
|
||||||
my_numchars_mb,
|
|
||||||
my_charpos_mb,
|
|
||||||
my_mb_wc_sjis, /* mb_wc */
|
|
||||||
my_wc_mb_sjis, /* wc_mb */
|
|
||||||
my_caseup_str_8bit,
|
|
||||||
my_casedn_str_8bit,
|
|
||||||
my_caseup_8bit,
|
|
||||||
my_casedn_8bit,
|
|
||||||
my_strcasecmp_8bit,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -688,6 +688,43 @@ void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_tis620,
|
||||||
|
my_strnncollsp_tis620,
|
||||||
|
my_strnxfrm_tis620,
|
||||||
|
my_like_range_tis620,
|
||||||
|
my_wildcmp_8bit, /* wildcmp */
|
||||||
|
my_strcasecmp_8bit,
|
||||||
|
my_hash_sort_simple,
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
NULL, /* ismbchar */
|
||||||
|
NULL, /* mbcharlen */
|
||||||
|
my_numchars_8bit,
|
||||||
|
my_charpos_8bit,
|
||||||
|
my_mb_wc_8bit, /* mb_wc */
|
||||||
|
my_wc_mb_8bit, /* wc_mb */
|
||||||
|
my_caseup_str_8bit,
|
||||||
|
my_casedn_str_8bit,
|
||||||
|
my_caseup_8bit,
|
||||||
|
my_casedn_8bit,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_tis620_thai_ci =
|
CHARSET_INFO my_charset_tis620_thai_ci =
|
||||||
{
|
{
|
||||||
18,0,0, /* number */
|
18,0,0, /* number */
|
||||||
@ -703,35 +740,10 @@ CHARSET_INFO my_charset_tis620_thai_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
4, /* strxfrm_multiply */
|
4, /* strxfrm_multiply */
|
||||||
my_strnncoll_tis620,
|
|
||||||
my_strnncollsp_tis620,
|
|
||||||
my_strnxfrm_tis620,
|
|
||||||
my_like_range_tis620,
|
|
||||||
my_wildcmp_8bit, /* wildcmp */
|
|
||||||
1, /* mbmaxlen */
|
1, /* mbmaxlen */
|
||||||
NULL, /* ismbchar */
|
|
||||||
NULL, /* mbcharlen */
|
|
||||||
my_numchars_8bit,
|
|
||||||
my_charpos_8bit,
|
|
||||||
my_mb_wc_8bit, /* mb_wc */
|
|
||||||
my_wc_mb_8bit, /* wc_mb */
|
|
||||||
my_caseup_str_8bit,
|
|
||||||
my_casedn_str_8bit,
|
|
||||||
my_caseup_8bit,
|
|
||||||
my_casedn_8bit,
|
|
||||||
my_strcasecmp_8bit,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -403,7 +403,7 @@ long my_strntol_ucs2(CHARSET_INFO *cs,
|
|||||||
*err= 0;
|
*err= 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0)
|
||||||
{
|
{
|
||||||
switch (wc)
|
switch (wc)
|
||||||
{
|
{
|
||||||
@ -438,7 +438,7 @@ bs:
|
|||||||
cutlim = (uint) (((ulong)~0L) % (unsigned long int) base);
|
cutlim = (uint) (((ulong)~0L) % (unsigned long int) base);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0)
|
||||||
{
|
{
|
||||||
s+=cnv;
|
s+=cnv;
|
||||||
if ( wc>='0' && wc<='9')
|
if ( wc>='0' && wc<='9')
|
||||||
@ -518,7 +518,7 @@ ulong my_strntoul_ucs2(CHARSET_INFO *cs,
|
|||||||
*err= 0;
|
*err= 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0)
|
||||||
{
|
{
|
||||||
switch (wc)
|
switch (wc)
|
||||||
{
|
{
|
||||||
@ -554,7 +554,7 @@ bs:
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0)
|
||||||
{
|
{
|
||||||
s+=cnv;
|
s+=cnv;
|
||||||
if ( wc>='0' && wc<='9')
|
if ( wc>='0' && wc<='9')
|
||||||
@ -628,7 +628,7 @@ longlong my_strntoll_ucs2(CHARSET_INFO *cs,
|
|||||||
*err= 0;
|
*err= 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0)
|
||||||
{
|
{
|
||||||
switch (wc)
|
switch (wc)
|
||||||
{
|
{
|
||||||
@ -663,7 +663,7 @@ bs:
|
|||||||
cutlim = (uint) ((~(ulonglong) 0) % (unsigned long int) base);
|
cutlim = (uint) ((~(ulonglong) 0) % (unsigned long int) base);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0)
|
||||||
{
|
{
|
||||||
s+=cnv;
|
s+=cnv;
|
||||||
if ( wc>='0' && wc<='9')
|
if ( wc>='0' && wc<='9')
|
||||||
@ -745,7 +745,7 @@ ulonglong my_strntoull_ucs2(CHARSET_INFO *cs,
|
|||||||
*err= 0;
|
*err= 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0)
|
||||||
{
|
{
|
||||||
switch (wc)
|
switch (wc)
|
||||||
{
|
{
|
||||||
@ -781,7 +781,7 @@ bs:
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ((cnv=cs->mb_wc(cs,&wc,s,e))>0)
|
if ((cnv=cs->cset->mb_wc(cs,&wc,s,e))>0)
|
||||||
{
|
{
|
||||||
s+=cnv;
|
s+=cnv;
|
||||||
if ( wc>='0' && wc<='9')
|
if ( wc>='0' && wc<='9')
|
||||||
@ -853,7 +853,7 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
length= sizeof(buf)-1;
|
length= sizeof(buf)-1;
|
||||||
end= s+length;
|
end= s+length;
|
||||||
|
|
||||||
while ((cnv=cs->mb_wc(cs,&wc,s,end)) > 0)
|
while ((cnv=cs->cset->mb_wc(cs,&wc,s,end)) > 0)
|
||||||
{
|
{
|
||||||
s+=cnv;
|
s+=cnv;
|
||||||
if (wc > (int) (uchar) 'e' || !wc)
|
if (wc > (int) (uchar) 'e' || !wc)
|
||||||
@ -913,7 +913,7 @@ int my_l10tostr_ucs2(CHARSET_INFO *cs,
|
|||||||
|
|
||||||
for ( db=dst, de=dst+len ; (dst<de) && *p ; p++)
|
for ( db=dst, de=dst+len ; (dst<de) && *p ; p++)
|
||||||
{
|
{
|
||||||
int cnvres=cs->wc_mb(cs,(my_wc_t)p[0],(uchar*) dst, (uchar*) de);
|
int cnvres=cs->cset->wc_mb(cs,(my_wc_t)p[0],(uchar*) dst, (uchar*) de);
|
||||||
if (cnvres>0)
|
if (cnvres>0)
|
||||||
dst+=cnvres;
|
dst+=cnvres;
|
||||||
else
|
else
|
||||||
@ -972,7 +972,7 @@ cnv:
|
|||||||
|
|
||||||
for ( db=dst, de=dst+len ; (dst<de) && *p ; p++)
|
for ( db=dst, de=dst+len ; (dst<de) && *p ; p++)
|
||||||
{
|
{
|
||||||
int cnvres=cs->wc_mb(cs, (my_wc_t) p[0], (uchar*) dst, (uchar*) de);
|
int cnvres=cs->cset->wc_mb(cs, (my_wc_t) p[0], (uchar*) dst, (uchar*) de);
|
||||||
if (cnvres>0)
|
if (cnvres>0)
|
||||||
dst+=cnvres;
|
dst+=cnvres;
|
||||||
else
|
else
|
||||||
@ -997,6 +997,44 @@ uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
return pos*2;
|
return pos*2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_ucs2,
|
||||||
|
my_strnncoll_ucs2,
|
||||||
|
my_strnxfrm_ucs2,
|
||||||
|
my_like_range_simple,
|
||||||
|
my_wildcmp_mb,
|
||||||
|
my_strcasecmp_ucs2,
|
||||||
|
my_hash_sort_ucs2
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
my_ismbchar_ucs2, /* ismbchar */
|
||||||
|
my_mbcharlen_ucs2, /* mbcharlen */
|
||||||
|
my_numchars_ucs2,
|
||||||
|
my_charpos_ucs2,
|
||||||
|
my_ucs2_uni, /* mb_wc */
|
||||||
|
my_uni_ucs2, /* wc_mb */
|
||||||
|
my_caseup_str_ucs2,
|
||||||
|
my_casedn_str_ucs2,
|
||||||
|
my_caseup_ucs2,
|
||||||
|
my_casedn_ucs2,
|
||||||
|
my_snprintf_ucs2,
|
||||||
|
my_l10tostr_ucs2,
|
||||||
|
my_ll10tostr_ucs2,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_ucs2,
|
||||||
|
my_strntoul_ucs2,
|
||||||
|
my_strntoll_ucs2,
|
||||||
|
my_strntoull_ucs2,
|
||||||
|
my_strntod_ucs2,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_ucs2_general_ci =
|
CHARSET_INFO my_charset_ucs2_general_ci =
|
||||||
{
|
{
|
||||||
35,0,0, /* number */
|
35,0,0, /* number */
|
||||||
@ -1012,35 +1050,10 @@ CHARSET_INFO my_charset_ucs2_general_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_ucs2, /* strnncoll */
|
|
||||||
my_strnncoll_ucs2,
|
|
||||||
my_strnxfrm_ucs2, /* strnxfrm */
|
|
||||||
my_like_range_simple,/* like_range */
|
|
||||||
my_wildcmp_mb, /* wildcmp */
|
|
||||||
2, /* mbmaxlen */
|
2, /* mbmaxlen */
|
||||||
my_ismbchar_ucs2, /* ismbchar */
|
|
||||||
my_mbcharlen_ucs2, /* mbcharlen */
|
|
||||||
my_numchars_ucs2,
|
|
||||||
my_charpos_ucs2,
|
|
||||||
my_ucs2_uni, /* mb_wc */
|
|
||||||
my_uni_ucs2, /* wc_mb */
|
|
||||||
my_caseup_str_ucs2,
|
|
||||||
my_casedn_str_ucs2,
|
|
||||||
my_caseup_ucs2,
|
|
||||||
my_casedn_ucs2,
|
|
||||||
my_strcasecmp_ucs2,
|
|
||||||
my_hash_sort_ucs2, /* hash_sort */
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_ucs2,
|
&my_charset_handler,
|
||||||
my_l10tostr_ucs2,
|
&my_collation_ci_handler
|
||||||
my_ll10tostr_ucs2,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_ucs2,
|
|
||||||
my_strntoul_ucs2,
|
|
||||||
my_strntoll_ucs2,
|
|
||||||
my_strntoull_ucs2,
|
|
||||||
my_strntod_ucs2,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -8425,6 +8425,44 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
|
|||||||
return MY_CS_ILUNI;
|
return MY_CS_ILUNI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_simple,/* strnncoll */
|
||||||
|
my_strnncollsp_simple,
|
||||||
|
my_strnxfrm_simple, /* strnxfrm */
|
||||||
|
my_like_range_simple,/* like_range */
|
||||||
|
my_wildcmp_mb, /* wildcmp */
|
||||||
|
my_strcasecmp_mb,
|
||||||
|
my_hash_sort_simple,
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
ismbchar_ujis,
|
||||||
|
mbcharlen_ujis,
|
||||||
|
my_numchars_mb,
|
||||||
|
my_charpos_mb,
|
||||||
|
my_mb_wc_euc_jp, /* mb_wc */
|
||||||
|
my_wc_mb_euc_jp, /* wc_mb */
|
||||||
|
my_caseup_str_mb,
|
||||||
|
my_casedn_str_mb,
|
||||||
|
my_caseup_mb,
|
||||||
|
my_casedn_mb,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_ujis_japanese_ci =
|
CHARSET_INFO my_charset_ujis_japanese_ci =
|
||||||
{
|
{
|
||||||
12,0,0, /* number */
|
12,0,0, /* number */
|
||||||
@ -8440,35 +8478,10 @@ CHARSET_INFO my_charset_ujis_japanese_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
|
||||||
my_strnncollsp_simple,
|
|
||||||
my_strnxfrm_simple, /* strnxfrm */
|
|
||||||
my_like_range_simple,/* like_range */
|
|
||||||
my_wildcmp_mb, /* wildcmp */
|
|
||||||
3, /* mbmaxlen */
|
3, /* mbmaxlen */
|
||||||
ismbchar_ujis,
|
|
||||||
mbcharlen_ujis,
|
|
||||||
my_numchars_mb,
|
|
||||||
my_charpos_mb,
|
|
||||||
my_mb_wc_euc_jp, /* mb_wc */
|
|
||||||
my_wc_mb_euc_jp, /* wc_mb */
|
|
||||||
my_caseup_str_mb,
|
|
||||||
my_casedn_str_mb,
|
|
||||||
my_caseup_mb,
|
|
||||||
my_casedn_mb,
|
|
||||||
my_strcasecmp_mb,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1950,6 +1950,44 @@ static int my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)) , uint c)
|
|||||||
return 0; /* Illegal mb head */;
|
return 0; /* Illegal mb head */;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_utf8,
|
||||||
|
my_strnncollsp_utf8,
|
||||||
|
my_strnxfrm_utf8,
|
||||||
|
my_like_range_simple,
|
||||||
|
my_wildcmp_mb,
|
||||||
|
my_strcasecmp_utf8,
|
||||||
|
my_hash_sort_utf8
|
||||||
|
};
|
||||||
|
|
||||||
|
static MY_CHARSET_HANDLER my_charset_handler=
|
||||||
|
{
|
||||||
|
my_ismbchar_utf8,
|
||||||
|
my_mbcharlen_utf8,
|
||||||
|
my_numchars_mb,
|
||||||
|
my_charpos_mb,
|
||||||
|
my_utf8_uni,
|
||||||
|
my_uni_utf8,
|
||||||
|
my_caseup_str_utf8,
|
||||||
|
my_casedn_str_utf8,
|
||||||
|
my_caseup_utf8,
|
||||||
|
my_casedn_utf8,
|
||||||
|
my_snprintf_8bit,
|
||||||
|
my_long10_to_str_8bit,
|
||||||
|
my_longlong10_to_str_8bit,
|
||||||
|
my_fill_8bit,
|
||||||
|
my_strntol_8bit,
|
||||||
|
my_strntoul_8bit,
|
||||||
|
my_strntoll_8bit,
|
||||||
|
my_strntoull_8bit,
|
||||||
|
my_strntod_8bit,
|
||||||
|
my_scan_8bit
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO my_charset_utf8_general_ci =
|
CHARSET_INFO my_charset_utf8_general_ci =
|
||||||
{
|
{
|
||||||
33,0,0, /* number */
|
33,0,0, /* number */
|
||||||
@ -1965,35 +2003,10 @@ CHARSET_INFO my_charset_utf8_general_ci =
|
|||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_utf8, /* strnncoll */
|
|
||||||
my_strnncollsp_utf8,
|
|
||||||
my_strnxfrm_utf8, /* strnxfrm */
|
|
||||||
my_like_range_simple,/* like_range */
|
|
||||||
my_wildcmp_mb, /* wildcmp */
|
|
||||||
3, /* mbmaxlen */
|
3, /* mbmaxlen */
|
||||||
my_ismbchar_utf8, /* ismbchar */
|
|
||||||
my_mbcharlen_utf8, /* mbcharlen */
|
|
||||||
my_numchars_mb,
|
|
||||||
my_charpos_mb,
|
|
||||||
my_utf8_uni, /* mb_wc */
|
|
||||||
my_uni_utf8, /* wc_mb */
|
|
||||||
my_caseup_str_utf8,
|
|
||||||
my_casedn_str_utf8,
|
|
||||||
my_caseup_utf8,
|
|
||||||
my_casedn_utf8,
|
|
||||||
my_strcasecmp_utf8,
|
|
||||||
my_hash_sort_utf8, /* hash_sort */
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -640,6 +640,17 @@ static my_bool my_like_range_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MY_COLLATION_HANDLER my_collation_czech_ci_handler =
|
||||||
|
{
|
||||||
|
my_strnncoll_win1250ch,
|
||||||
|
my_strnncollsp_win1250ch,
|
||||||
|
my_strnxfrm_win1250ch,
|
||||||
|
my_like_range_win1250ch,
|
||||||
|
my_wildcmp_8bit,
|
||||||
|
my_strcasecmp_8bit,
|
||||||
|
my_hash_sort_simple
|
||||||
|
};
|
||||||
|
|
||||||
CHARSET_INFO my_charset_cp1250_czech_ci =
|
CHARSET_INFO my_charset_cp1250_czech_ci =
|
||||||
{
|
{
|
||||||
34,0,0, /* number */
|
34,0,0, /* number */
|
||||||
@ -655,35 +666,10 @@ CHARSET_INFO my_charset_cp1250_czech_ci =
|
|||||||
idx_uni_cp1250, /* tab_from_uni */
|
idx_uni_cp1250, /* tab_from_uni */
|
||||||
"","",
|
"","",
|
||||||
2, /* strxfrm_multiply */
|
2, /* strxfrm_multiply */
|
||||||
my_strnncoll_win1250ch,
|
|
||||||
my_strnncollsp_win1250ch,
|
|
||||||
my_strnxfrm_win1250ch,
|
|
||||||
my_like_range_win1250ch,
|
|
||||||
my_wildcmp_8bit, /* wildcmp */
|
|
||||||
1, /* mbmaxlen */
|
1, /* mbmaxlen */
|
||||||
NULL, /* ismbchar */
|
|
||||||
NULL, /* mbcharlen */
|
|
||||||
my_numchars_8bit,
|
|
||||||
my_charpos_8bit,
|
|
||||||
my_mb_wc_8bit, /* mb_wc */
|
|
||||||
my_wc_mb_8bit, /* wc_mb */
|
|
||||||
my_caseup_str_8bit,
|
|
||||||
my_casedn_str_8bit,
|
|
||||||
my_caseup_8bit,
|
|
||||||
my_casedn_8bit,
|
|
||||||
my_strcasecmp_8bit,
|
|
||||||
my_hash_sort_simple,
|
|
||||||
0,
|
0,
|
||||||
my_snprintf_8bit,
|
&my_charset_8bit_handler,
|
||||||
my_long10_to_str_8bit,
|
&my_collation_czech_ci_handler
|
||||||
my_longlong10_to_str_8bit,
|
|
||||||
my_fill_8bit,
|
|
||||||
my_strntol_8bit,
|
|
||||||
my_strntoul_8bit,
|
|
||||||
my_strntoll_8bit,
|
|
||||||
my_strntoull_8bit,
|
|
||||||
my_strntod_8bit,
|
|
||||||
my_scan_8bit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user