Preparing for charset dependant int10_to_str

This commit is contained in:
unknown 2002-12-11 12:30:05 +04:00
parent 540b243ace
commit c8a50df16c
15 changed files with 129 additions and 27 deletions

View file

@ -123,7 +123,9 @@ typedef struct charset_info_st
char max_sort_char; /* For LIKE optimization */
/* 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, ...);
int (*l10tostr)(struct charset_info_st *, char *to, uint n, int radix, long int val);
int (*ll10tostr)(struct charset_info_st *, char *to, uint n, int radix, longlong val);
long (*strntol)(struct charset_info_st *, const char *s, uint l,char **e, int base);
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l, char **e, int base);
@ -175,6 +177,9 @@ longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l,char **e, int
ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l,char **e, int base);
double my_strntod_8bit(CHARSET_INFO *, const char *s, uint l,char **e);
int my_l10tostr_8bit(CHARSET_INFO *, char *to, uint l, int radix, long int val);
int my_ll10tostr_8bit(CHARSET_INFO *, char *to, uint l, int radix, longlong val);
my_bool my_like_range_simple(CHARSET_INFO *cs,
const char *ptr, uint ptr_length,
int escape, int w_one, int w_many,

View file

@ -6249,6 +6249,9 @@ CHARSET_INFO my_charset_big5 =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,

View file

@ -290,12 +290,13 @@ static CHARSET_INFO my_charset_bin_st =
my_hash_sort_bin, /* hash_sort */
255, /* max_sort_char */
my_snprintf_8bit, /* snprintf */
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
my_strntoull_8bit,
my_strntod_8bit
my_strntod_8bit,
};

View file

@ -627,6 +627,8 @@ CHARSET_INFO my_charset_czech =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,

View file

@ -8667,6 +8667,8 @@ CHARSET_INFO my_charset_euc_kr =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,

View file

@ -5717,6 +5717,8 @@ CHARSET_INFO my_charset_gb2312 =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,

View file

@ -9904,11 +9904,13 @@ CHARSET_INFO my_charset_gbk =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
my_strntoull_8bit,
my_strntod_8bit
my_strntod_8bit,
};

View file

@ -445,6 +445,8 @@ CHARSET_INFO my_charset_latin1_de =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,

View file

@ -710,6 +710,29 @@ double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)),
}
/*
This is a fast version optimized for the case of radix 10 / -10
*/
int my_l10tostr_8bit(CHARSET_INFO *cs __attribute__((unused)),
char *dst, uint len, int radix, long int val)
{
val=radix=len;
dst[0]='\0';
return 0;
}
int my_ll10tostr_8bit(CHARSET_INFO *cs __attribute__((unused)),
char *dst, uint len, int radix, longlong val)
{
val=radix=len;
dst[0]='\0';
return 0;
}
/*
** Compare string against string with wildcard
** 0 if matched

View file

@ -4491,6 +4491,8 @@ CHARSET_INFO my_charset_sjis =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,

View file

@ -719,6 +719,8 @@ CHARSET_INFO my_charset_tis620 =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,

View file

@ -8461,6 +8461,8 @@ CHARSET_INFO my_charset_ujis =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,

View file

@ -1989,11 +1989,13 @@ CHARSET_INFO my_charset_utf8 =
my_hash_sort_utf8, /* hash_sort */
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
my_strntoull_8bit,
my_strntod_8bit
my_strntod_8bit,
};
@ -2942,6 +2944,8 @@ CHARSET_INFO my_charset_ucs2 =
my_hash_sort_ucs2, /* hash_sort */
0,
my_snprintf_ucs2,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_ucs2,
my_strntoul_ucs2,
my_strntoll_ucs2,

View file

@ -653,6 +653,8 @@ CHARSET_INFO my_charset_win1250ch =
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,

View file

@ -2841,6 +2841,8 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -2883,7 +2885,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -2925,7 +2929,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -2967,7 +2973,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3010,7 +3018,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3052,7 +3062,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3094,7 +3106,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3136,7 +3150,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3179,7 +3195,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3221,7 +3239,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3263,7 +3283,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3305,7 +3327,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3347,7 +3371,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3389,7 +3415,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3431,7 +3459,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3474,7 +3504,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3516,7 +3548,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3559,7 +3593,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3602,7 +3638,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3644,7 +3682,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3686,7 +3726,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3728,7 +3770,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3770,7 +3814,9 @@ static CHARSET_INFO compiled_charsets[] = {
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit
my_snprintf_8bit,
my_l10tostr_8bit,
my_ll10tostr_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
@ -3818,6 +3864,8 @@ static CHARSET_INFO compiled_charsets[] = {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
}
};