mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
New scan() function in CHARSET_INFO structure (not used yet)
This commit is contained in:
parent
ee0f0a81da
commit
4b75a129fc
16 changed files with 104 additions and 33 deletions
|
@ -49,6 +49,9 @@ typedef struct unicase_info_st {
|
|||
#define MY_CS_TOOSMALL -1
|
||||
#define MY_CS_TOOFEW(n) (-1-(n))
|
||||
|
||||
#define MY_SEQ_INTTAIL 1
|
||||
#define MY_SEQ_SPACES 2
|
||||
|
||||
/* My charsets_list flags */
|
||||
#define MY_NO_SETS 0
|
||||
#define MY_CS_COMPILED 1 /* compiled-in sets */
|
||||
|
@ -144,6 +147,8 @@ typedef struct charset_info_st
|
|||
ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l, int base, char **e, int *err);
|
||||
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e, int *err);
|
||||
|
||||
ulong (*scan)(struct charset_info_st *, const char *b, const char *e, int sq);
|
||||
|
||||
} CHARSET_INFO;
|
||||
|
||||
|
||||
|
@ -181,6 +186,8 @@ extern int my_strncasecmp_8bit(CHARSET_INFO * cs, const char *, const char *, ui
|
|||
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
|
||||
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
|
||||
|
||||
ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
|
||||
|
||||
int my_snprintf_8bit(struct charset_info_st *, char *to, uint n, const char *fmt, ...);
|
||||
|
||||
long my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base, char **e, int *err);
|
||||
|
|
|
@ -80,6 +80,7 @@ static void simple_cs_init_functions(CHARSET_INFO *cs)
|
|||
cs->strntoll = my_strntoll_8bit;
|
||||
cs->strntoull = my_strntoull_8bit;
|
||||
cs->strntod = my_strntod_8bit;
|
||||
cs->scan = my_scan_8bit;
|
||||
cs->mbmaxlen = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -6257,7 +6257,8 @@ CHARSET_INFO my_charset_big5 =
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -305,6 +305,7 @@ static CHARSET_INFO my_charset_bin_st =
|
|||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -634,7 +634,8 @@ CHARSET_INFO my_charset_czech =
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -8674,7 +8674,8 @@ CHARSET_INFO my_charset_euc_kr =
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5724,7 +5724,8 @@ CHARSET_INFO my_charset_gb2312 =
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -9912,6 +9912,7 @@ CHARSET_INFO my_charset_gbk =
|
|||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -452,7 +452,8 @@ CHARSET_INFO my_charset_latin1_de =
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -968,3 +968,29 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
|
|||
*min_str++ = *max_str++ = ' '; // Because if key compression
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
|
||||
{
|
||||
const char *str0= str;
|
||||
switch (sq)
|
||||
{
|
||||
case MY_SEQ_INTTAIL:
|
||||
if (*str == '.')
|
||||
{
|
||||
for(str++ ; str != end && *str == '0' ; str++);
|
||||
return str-str0;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case MY_SEQ_SPACES:
|
||||
for (str++ ; str != end ; str++)
|
||||
{
|
||||
if (!my_isspace(cs,*str))
|
||||
break;
|
||||
}
|
||||
return str-str0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4498,7 +4498,8 @@ CHARSET_INFO my_charset_sjis =
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -726,7 +726,8 @@ CHARSET_INFO my_charset_tis620 =
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -8468,7 +8468,8 @@ CHARSET_INFO my_charset_ujis =
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -2000,6 +2000,7 @@ CHARSET_INFO my_charset_utf8 =
|
|||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
|
||||
|
@ -3073,7 +3074,8 @@ CHARSET_INFO my_charset_ucs2 =
|
|||
my_strntoul_ucs2,
|
||||
my_strntoll_ucs2,
|
||||
my_strntoull_ucs2,
|
||||
my_strntod_ucs2
|
||||
my_strntod_ucs2,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -660,7 +660,8 @@ CHARSET_INFO my_charset_win1250ch =
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -2849,7 +2849,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -2895,7 +2896,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -2940,7 +2942,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -2985,7 +2988,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3031,7 +3035,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3076,7 +3081,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3121,7 +3127,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3166,7 +3173,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3212,7 +3220,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3257,7 +3266,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3302,7 +3312,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3347,7 +3358,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3392,7 +3404,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3437,7 +3450,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3482,7 +3496,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3528,7 +3543,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3573,7 +3589,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3619,7 +3636,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3665,7 +3683,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3710,7 +3729,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3755,7 +3775,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3800,7 +3821,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3845,7 +3867,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
my_strntoul_8bit,
|
||||
my_strntoll_8bit,
|
||||
my_strntoull_8bit,
|
||||
my_strntod_8bit
|
||||
my_strntod_8bit,
|
||||
my_scan_8bit
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -3891,6 +3914,7 @@ static CHARSET_INFO compiled_charsets[] = {
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue