MySQL 8.0.39
Source Code Documentation
|
A better implementation of the UNIX ctype(3) library. More...
#include <stddef.h>
#include <sys/types.h>
#include <cassert>
#include <cstdint>
#include <cstring>
#include "my_compiler.h"
#include "my_inttypes.h"
#include "my_loglevel.h"
#include "my_macros.h"
#include "my_sharedlib.h"
#include "template_utils.h"
Go to the source code of this file.
Classes | |
struct | MY_UNICASE_CHARACTER |
struct | MY_UNICASE_INFO |
struct | MY_UNI_CTYPE |
struct | MY_UNI_IDX |
struct | my_match_t |
struct | MY_CHARSET_LOADER |
struct | MY_COLLATION_HANDLER |
struct | MY_CHARSET_HANDLER |
struct | CHARSET_INFO |
Macros | |
#define | MY_CS_NAME_SIZE 32 |
#define | MY_CS_CTYPE_TABLE_SIZE 257 |
#define | MY_CS_TO_LOWER_TABLE_SIZE 256 |
#define | MY_CS_TO_UPPER_TABLE_SIZE 256 |
#define | MY_CS_SORT_ORDER_TABLE_SIZE 256 |
#define | MY_CS_TO_UNI_TABLE_SIZE 256 |
#define | CHARSET_DIR "charsets/" |
#define | MY_CS_REPLACEMENT_CHARACTER 0xFFFD |
#define | MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */ |
#define | MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */ |
#define | MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */ |
#define | MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */ |
#define | MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */ |
#define | MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */ |
#define | MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */ |
#define | MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */ |
#define | MY_CS_TOOSMALLN(n) (-100 - (n)) |
#define | MY_SEQ_INTTAIL 1 |
#define | MY_SEQ_SPACES 2 |
#define | MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */ |
#define | MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */ |
#define | MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */ |
#define | MY_STRXFRM_PAD_TO_MAXLEN 0x00000080 /* if pad tail(for filesort) */ |
#define | ILLEGAL_CHARSET_INFO_NUMBER (~0U) |
#define | _MY_U 01 /* Upper case */ |
#define | _MY_L 02 /* Lower case */ |
#define | _MY_NMR 04 /* Numeral (digit) */ |
#define | _MY_SPC 010 /* Spacing character */ |
#define | _MY_PNT 020 /* Punctuation */ |
#define | _MY_CTR 040 /* Control character */ |
#define | _MY_B 0100 /* Blank */ |
#define | _MY_X 0200 /* heXadecimal digit */ |
#define | my_isascii(c) (!((c) & ~0177)) |
#define | my_toupper(s, c) (char)((s)->to_upper[(uchar)(c)]) |
#define | my_tolower(s, c) (char)((s)->to_lower[(uchar)(c)]) |
#define | my_isalpha(s, c) (((s)->ctype + 1)[(uchar)(c)] & (_MY_U | _MY_L)) |
#define | my_isupper(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_U) |
#define | my_islower(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_L) |
#define | my_isdigit(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_NMR) |
#define | my_isxdigit(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_X) |
#define | my_isalnum(s, c) (((s)->ctype + 1)[(uchar)(c)] & (_MY_U | _MY_L | _MY_NMR)) |
#define | my_isspace(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_SPC) |
#define | my_ispunct(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_PNT) |
#define | my_isprint(s, c) (((s)->ctype + 1)[(uchar)(c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B)) |
#define | my_isgraph(s, c) (((s)->ctype + 1)[(uchar)(c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR)) |
#define | my_iscntrl(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_CTR) |
#define | my_isvar(s, c) (my_isalnum(s, c) || (c) == '_') |
#define | my_isvar_start(s, c) (my_isalpha(s, c) || (c) == '_') |
#define | my_binary_compare(s) ((s)->state & MY_CS_BINSORT) |
#define | use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM) |
#define | my_strnxfrm(cs, d, dl, s, sl) ((cs)->coll->strnxfrm((cs), (d), (dl), (dl), (s), (sl), 0)) |
#define | my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0)) |
#define | my_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)->coll->wildcmp((cs), (s), (se), (w), (we), (e), (o), (m))) |
#define | my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b))) |
#define | my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char *)(b), (const char *)(e), (num)) |
#define | use_mb(s) ((s)->cset->ismbchar != NULL) |
#define | my_mbcharlen(s, a) ((s)->cset->mbcharlen((s), (a))) |
#define | my_mbcharlen_2(s, a, b) ((s)->cset->mbcharlen((s), ((((a)&0xFF) << 8) + ((b)&0xFF)))) |
Get the length of gb18030 code by the given two leading bytes. More... | |
#define | my_mbmaxlenlen(s) ((s)->mbmaxlenlen) |
Get the maximum length of leading bytes needed to determine the length of a multi-byte gb18030 code. More... | |
#define | my_ismb1st(s, i) |
Judge if the given byte is a possible leading byte for a charset. More... | |
#define | my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a))) |
#define | my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a))) |
#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_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((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_strntod(s, a, b, c, d) ((s)->cset->strntod((s), (a), (b), (c), (d))) |
Typedefs | |
typedef ulong | my_wc_t |
Our own version of wchar_t, ie., a type that holds a single Unicode code point ("wide character"). More... | |
typedef struct MY_UNICASE_CHARACTER | MY_UNICASE_CHARACTER |
typedef struct MY_UNICASE_INFO | MY_UNICASE_INFO |
typedef struct MY_UNI_CTYPE | MY_UNI_CTYPE |
typedef struct MY_UNI_IDX | MY_UNI_IDX |
typedef struct MY_COLLATION_HANDLER | MY_COLLATION_HANDLER |
typedef int(* | my_charset_conv_mb_wc) (const CHARSET_INFO *, my_wc_t *, const uchar *, const uchar *) |
typedef int(* | my_charset_conv_wc_mb) (const CHARSET_INFO *, my_wc_t, uchar *, uchar *) |
typedef size_t(* | my_charset_conv_case) (const CHARSET_INFO *, char *, size_t, char *, size_t) |
typedef struct MY_CHARSET_HANDLER | MY_CHARSET_HANDLER |
Enumerations | |
enum | Pad_attribute { PAD_SPACE , NO_PAD } |
Functions | |
static void | MY_PUT_MB2 (unsigned char *s, uint16 code) |
size_t | my_strnxfrm_simple (const CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags) |
size_t | my_strnxfrmlen_simple (const CHARSET_INFO *, size_t) |
int | my_strnncoll_simple (const CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t, bool) |
int | my_strnncollsp_simple (const CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t) |
void | my_hash_sort_simple (const CHARSET_INFO *cs, const uchar *key, size_t len, uint64 *nr1, uint64 *nr2) |
size_t | my_lengthsp_8bit (const CHARSET_INFO *cs, const char *ptr, size_t length) |
uint | my_instr_simple (const CHARSET_INFO *, const char *b, size_t b_length, const char *s, size_t s_length, my_match_t *match, uint nmatch) |
size_t | my_caseup_str_8bit (const CHARSET_INFO *, char *) |
size_t | my_casedn_str_8bit (const CHARSET_INFO *, char *) |
size_t | my_caseup_8bit (const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen) |
size_t | my_casedn_8bit (const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen) |
int | my_strcasecmp_8bit (const CHARSET_INFO *cs, const char *, const char *) |
int | my_mb_wc_8bit (const CHARSET_INFO *cs, my_wc_t *wc, const uchar *s, const uchar *e) |
int | my_wc_mb_8bit (const CHARSET_INFO *cs, my_wc_t wc, uchar *s, uchar *e) |
int | my_mb_ctype_8bit (const CHARSET_INFO *, int *, const uchar *, const uchar *) |
int | my_mb_ctype_mb (const CHARSET_INFO *, int *, const uchar *, const uchar *) |
size_t | my_scan_8bit (const CHARSET_INFO *cs, const char *b, const char *e, int sq) |
size_t | my_snprintf_8bit (const CHARSET_INFO *, char *to, size_t n, const char *fmt,...) |
long | my_strntol_8bit (const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err) |
ulong | my_strntoul_8bit (const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err) |
longlong | my_strntoll_8bit (const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err) |
ulonglong | my_strntoull_8bit (const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err) |
double | my_strntod_8bit (const CHARSET_INFO *, const char *s, size_t l, const char **e, int *err) |
size_t | my_long10_to_str_8bit (const CHARSET_INFO *, char *to, size_t l, int radix, long int val) |
size_t | my_longlong10_to_str_8bit (const CHARSET_INFO *, char *to, size_t l, int radix, longlong val) |
longlong | my_strtoll10_8bit (const CHARSET_INFO *cs, const char *nptr, const char **endptr, int *error) |
longlong | my_strtoll10_ucs2 (const CHARSET_INFO *cs, const char *nptr, char **endptr, int *error) |
ulonglong | my_strntoull10rnd_8bit (const CHARSET_INFO *cs, const char *str, size_t length, int unsigned_fl, const char **endptr, int *error) |
ulonglong | my_strntoull10rnd_ucs2 (const CHARSET_INFO *cs, const char *str, size_t length, int unsigned_fl, char **endptr, int *error) |
void | my_fill_8bit (const CHARSET_INFO *cs, char *to, size_t l, int fill) |
bool | my_like_range_simple (const CHARSET_INFO *cs, const char *ptr, size_t ptr_length, char escape, char w_one, char w_many, size_t res_length, char *min_str, char *max_str, size_t *min_length, size_t *max_length) |
bool | my_like_range_mb (const CHARSET_INFO *cs, const char *ptr, size_t ptr_length, char escape, char w_one, char w_many, size_t res_length, char *min_str, char *max_str, size_t *min_length, size_t *max_length) |
bool | my_like_range_generic (const CHARSET_INFO *cs, const char *ptr, size_t ptr_length, char escape, char w_one, char w_many, size_t res_length, char *min_str, char *max_str, size_t *min_length, size_t *max_length) |
Calculate min_str and max_str that ranges a LIKE string. More... | |
int | my_wildcmp_8bit (const CHARSET_INFO *, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many) |
int | my_wildcmp_bin (const CHARSET_INFO *, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many) |
size_t | my_numchars_8bit (const CHARSET_INFO *, const char *b, const char *e) |
size_t | my_numcells_8bit (const CHARSET_INFO *, const char *b, const char *e) |
size_t | my_charpos_8bit (const CHARSET_INFO *, const char *b, const char *e, size_t pos) |
size_t | my_well_formed_len_8bit (const CHARSET_INFO *, const char *b, const char *e, size_t pos, int *error) |
uint | my_mbcharlen_8bit (const CHARSET_INFO *, uint c) |
size_t | my_caseup_str_mb (const CHARSET_INFO *, char *) |
size_t | my_casedn_str_mb (const CHARSET_INFO *, char *) |
size_t | my_caseup_mb (const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen) |
size_t | my_casedn_mb (const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen) |
size_t | my_caseup_mb_varlen (const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen) |
size_t | my_casedn_mb_varlen (const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen) |
size_t | my_caseup_ujis (const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen) |
size_t | my_casedn_ujis (const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen) |
int | my_strcasecmp_mb (const CHARSET_INFO *cs, const char *, const char *) |
int | my_wildcmp_mb (const CHARSET_INFO *, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many) |
size_t | my_numchars_mb (const CHARSET_INFO *, const char *b, const char *e) |
size_t | my_numcells_mb (const CHARSET_INFO *, const char *b, const char *e) |
size_t | my_charpos_mb3 (const CHARSET_INFO *, const char *b, const char *e, size_t pos) |
size_t | my_well_formed_len_mb (const CHARSET_INFO *, const char *b, const char *e, size_t pos, int *error) |
uint | my_instr_mb (const CHARSET_INFO *, const char *b, size_t b_length, const char *s, size_t s_length, my_match_t *match, uint nmatch) |
int | my_strnncoll_mb_bin (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, bool t_is_prefix) |
int | my_strnncollsp_mb_bin (const CHARSET_INFO *cs, const uchar *a, size_t a_length, const uchar *b, size_t b_length) |
int | my_wildcmp_mb_bin (const CHARSET_INFO *cs, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many) |
int | my_strcasecmp_mb_bin (const CHARSET_INFO *cs, const char *s, const char *t) |
void | my_hash_sort_mb_bin (const CHARSET_INFO *cs, const uchar *key, size_t len, uint64 *nr1, uint64 *nr2) |
size_t | my_strnxfrm_mb (const CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags) |
size_t | my_strnxfrm_unicode (const CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags) |
size_t | my_strnxfrm_unicode_full_bin (const CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags) |
size_t | my_strnxfrmlen_unicode_full_bin (const CHARSET_INFO *, size_t) |
int | my_wildcmp_unicode (const CHARSET_INFO *cs, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many, const MY_UNICASE_INFO *weights) |
bool | my_parse_charset_xml (MY_CHARSET_LOADER *loader, const char *buf, size_t buflen) |
size_t | my_strcspn (const CHARSET_INFO *cs, const char *str, const char *end, const char *reject, size_t reject_length) |
Calculate the length of the initial segment of 'str' which consists entirely of characters not in 'reject'. More... | |
bool | my_propagate_simple (const CHARSET_INFO *cs, const uchar *str, size_t len) |
bool | my_propagate_complex (const CHARSET_INFO *cs, const uchar *str, size_t len) |
uint | my_string_repertoire (const CHARSET_INFO *cs, const char *str, size_t len) |
static bool | my_charset_is_ascii_based (const CHARSET_INFO *cs) |
Detect whether a character set is ASCII compatible. More... | |
bool | my_charset_same (const CHARSET_INFO *cs1, const CHARSET_INFO *cs2) |
bool | my_charset_is_8bit_pure_ascii (const CHARSET_INFO *cs) |
uint | my_charset_repertoire (const CHARSET_INFO *cs) |
uint | my_strxfrm_flag_normalize (uint flags) |
size_t | my_strxfrm_pad (const CHARSET_INFO *cs, uchar *str, uchar *frmend, uchar *strend, uint nweights, uint flags) |
bool | my_charset_is_ascii_compatible (const CHARSET_INFO *cs) |
size_t | my_convert (char *to, size_t to_length, const CHARSET_INFO *to_cs, const char *from, size_t from_length, const CHARSET_INFO *from_cs, uint *errors) |
Convert a string between two character sets. More... | |
uint | my_mbcharlen_ptr (const CHARSET_INFO *cs, const char *s, const char *e) |
Get the length of the first code in given sequence of chars. More... | |
bool | my_is_prefixidx_cand (const CHARSET_INFO *cs, const char *wildstr, const char *wildend, int escape, int w_many, size_t *prefix_len) |
Identify whether given like pattern looks like a prefix pattern, which can become candidate for index only scan on prefix indexes. More... | |
static uint | my_ismbchar (const CHARSET_INFO *cs, const char *str, const char *strend) |
static uint | my_ismbchar (const CHARSET_INFO *cs, const uchar *str, const uchar *strend) |
static bool | is_supported_parser_charset (const CHARSET_INFO *cs) |
A better implementation of the UNIX ctype(3) library.
#define _MY_B 0100 /* Blank */ |
#define _MY_CTR 040 /* Control character */ |
#define _MY_L 02 /* Lower case */ |
#define _MY_NMR 04 /* Numeral (digit) */ |
#define _MY_PNT 020 /* Punctuation */ |
#define _MY_SPC 010 /* Spacing character */ |
#define _MY_U 01 /* Upper case */ |
#define _MY_X 0200 /* heXadecimal digit */ |
#define CHARSET_DIR "charsets/" |
#define ILLEGAL_CHARSET_INFO_NUMBER (~0U) |
#define my_binary_compare | ( | s | ) | ((s)->state & MY_CS_BINSORT) |
#define my_casedn_str | ( | s, | |
a | |||
) | ((s)->cset->casedn_str((s), (a))) |
#define my_caseup_str | ( | s, | |
a | |||
) | ((s)->cset->caseup_str((s), (a))) |
#define my_charpos | ( | cs, | |
b, | |||
e, | |||
num | |||
) | (cs)->cset->charpos((cs), (const char *)(b), (const char *)(e), (num)) |
#define MY_CS_CTYPE_TABLE_SIZE 257 |
#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */ |
#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */ |
#define MY_CS_NAME_SIZE 32 |
#define MY_CS_REPLACEMENT_CHARACTER 0xFFFD |
#define MY_CS_SORT_ORDER_TABLE_SIZE 256 |
#define MY_CS_TO_LOWER_TABLE_SIZE 256 |
#define MY_CS_TO_UNI_TABLE_SIZE 256 |
#define MY_CS_TO_UPPER_TABLE_SIZE 256 |
#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */ |
#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */ |
#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */ |
#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */ |
#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */ |
#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */ |
#define my_isascii | ( | c | ) | (!((c) & ~0177)) |
#define my_ismb1st | ( | s, | |
i | |||
) |
Judge if the given byte is a possible leading byte for a charset.
For gb18030 whose mbmaxlenlen is 2, we can't determine the length of a multi-byte character by looking at the first byte only
[in] | s | charset_info |
[in] | i | possible leading byte |
#define my_isprint | ( | s, | |
c | |||
) | (((s)->ctype + 1)[(uchar)(c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B)) |
#define my_isvar | ( | s, | |
c | |||
) | (my_isalnum(s, c) || (c) == '_') |
#define my_isvar_start | ( | s, | |
c | |||
) | (my_isalpha(s, c) || (c) == '_') |
#define my_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_mbcharlen | ( | s, | |
a | |||
) | ((s)->cset->mbcharlen((s), (a))) |
#define my_mbcharlen_2 | ( | s, | |
a, | |||
b | |||
) | ((s)->cset->mbcharlen((s), ((((a)&0xFF) << 8) + ((b)&0xFF)))) |
Get the length of gb18030 code by the given two leading bytes.
[in] | s | charset_info |
[in] | a | first byte of gb18030 code |
[in] | b | second byte of gb18030 code |
#define my_mbmaxlenlen | ( | s | ) | ((s)->mbmaxlenlen) |
Get the maximum length of leading bytes needed to determine the length of a multi-byte gb18030 code.
[in] | s | charset_info |
#define MY_SEQ_INTTAIL 1 |
#define MY_SEQ_SPACES 2 |
#define my_strcasecmp | ( | s, | |
a, | |||
b | |||
) | ((s)->coll->strcasecmp((s), (a), (b))) |
#define my_strnncoll | ( | s, | |
a, | |||
b, | |||
c, | |||
d | |||
) | ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0)) |
#define my_strntod | ( | s, | |
a, | |||
b, | |||
c, | |||
d | |||
) | ((s)->cset->strntod((s), (a), (b), (c), (d))) |
#define my_strntol | ( | s, | |
a, | |||
b, | |||
c, | |||
d, | |||
e | |||
) | ((s)->cset->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)->cset->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_strnxfrm | ( | cs, | |
d, | |||
dl, | |||
s, | |||
sl | |||
) | ((cs)->coll->strnxfrm((cs), (d), (dl), (dl), (s), (sl), 0)) |
#define my_toupper | ( | s, | |
c | |||
) | (char)((s)->to_upper[(uchar)(c)]) |
#define my_wildcmp | ( | cs, | |
s, | |||
se, | |||
w, | |||
we, | |||
e, | |||
o, | |||
m | |||
) | ((cs)->coll->wildcmp((cs), (s), (se), (w), (we), (e), (o), (m))) |
#define use_mb | ( | s | ) | ((s)->cset->ismbchar != NULL) |
#define use_strnxfrm | ( | s | ) | ((s)->state & MY_CS_STRNXFRM) |
typedef size_t(* my_charset_conv_case) (const CHARSET_INFO *, char *, size_t, char *, size_t) |
typedef int(* my_charset_conv_mb_wc) (const CHARSET_INFO *, my_wc_t *, const uchar *, const uchar *) |
typedef int(* my_charset_conv_wc_mb) (const CHARSET_INFO *, my_wc_t, uchar *, uchar *) |
typedef struct MY_CHARSET_HANDLER MY_CHARSET_HANDLER |
typedef struct MY_COLLATION_HANDLER MY_COLLATION_HANDLER |
typedef struct MY_UNI_CTYPE MY_UNI_CTYPE |
typedef struct MY_UNI_IDX MY_UNI_IDX |
typedef struct MY_UNICASE_CHARACTER MY_UNICASE_CHARACTER |
typedef struct MY_UNICASE_INFO MY_UNICASE_INFO |
typedef ulong my_wc_t |
Our own version of wchar_t, ie., a type that holds a single Unicode code point ("wide character").
ulong is always big enough to hold any character in the BMP.
enum Pad_attribute |
|
inlinestatic |
size_t my_casedn_8bit | ( | const CHARSET_INFO * | cs, |
char * | src, | ||
size_t | srclen, | ||
char * | dst, | ||
size_t | dstlen | ||
) |
size_t my_casedn_mb | ( | const CHARSET_INFO * | cs, |
char * | src, | ||
size_t | srclen, | ||
char * | dst, | ||
size_t | dstlen | ||
) |
size_t my_casedn_mb_varlen | ( | const CHARSET_INFO * | cs, |
char * | src, | ||
size_t | srclen, | ||
char * | dst, | ||
size_t | dstlen | ||
) |
size_t my_casedn_str_8bit | ( | const CHARSET_INFO * | cs, |
char * | str | ||
) |
size_t my_casedn_str_mb | ( | const CHARSET_INFO * | cs, |
char * | str | ||
) |
size_t my_casedn_ujis | ( | const CHARSET_INFO * | cs, |
char * | src, | ||
size_t | srclen, | ||
char * | dst, | ||
size_t | dstlen | ||
) |
size_t my_caseup_8bit | ( | const CHARSET_INFO * | cs, |
char * | src, | ||
size_t | srclen, | ||
char * | dst, | ||
size_t | dstlen | ||
) |
size_t my_caseup_mb | ( | const CHARSET_INFO * | cs, |
char * | src, | ||
size_t | srclen, | ||
char * | dst, | ||
size_t | dstlen | ||
) |
size_t my_caseup_mb_varlen | ( | const CHARSET_INFO * | cs, |
char * | src, | ||
size_t | srclen, | ||
char * | dst, | ||
size_t | dstlen | ||
) |
size_t my_caseup_str_8bit | ( | const CHARSET_INFO * | cs, |
char * | str | ||
) |
size_t my_caseup_str_mb | ( | const CHARSET_INFO * | cs, |
char * | str | ||
) |
size_t my_caseup_ujis | ( | const CHARSET_INFO * | cs, |
char * | src, | ||
size_t | srclen, | ||
char * | dst, | ||
size_t | dstlen | ||
) |
size_t my_charpos_8bit | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
const char * | e, | ||
size_t | pos | ||
) |
size_t my_charpos_mb3 | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
const char * | e, | ||
size_t | pos | ||
) |
bool my_charset_is_8bit_pure_ascii | ( | const CHARSET_INFO * | cs | ) |
|
inlinestatic |
Detect whether a character set is ASCII compatible.
bool my_charset_is_ascii_compatible | ( | const CHARSET_INFO * | cs | ) |
uint my_charset_repertoire | ( | const CHARSET_INFO * | cs | ) |
|
inline |
size_t my_convert | ( | char * | to, |
size_t | to_length, | ||
const CHARSET_INFO * | to_cs, | ||
const char * | from, | ||
size_t | from_length, | ||
const CHARSET_INFO * | from_cs, | ||
uint * | errors | ||
) |
Convert a string between two character sets.
Optimized for quick copying of ASCII characters in the range 0x00..0x7F. 'to' must be large enough to store (form_length * to_cs->mbmaxlen) bytes.
[out] | to | Store result here |
to_length | Size of "to" buffer | |
to_cs | Character set of result string | |
from | Copy from here | |
from_length | Length of the "from" string | |
from_cs | Character set of the "from" string | |
[out] | errors | Number of conversion errors |
void my_fill_8bit | ( | const CHARSET_INFO * | cs, |
char * | to, | ||
size_t | l, | ||
int | fill | ||
) |
void my_hash_sort_mb_bin | ( | const CHARSET_INFO * | cs, |
const uchar * | key, | ||
size_t | len, | ||
uint64 * | nr1, | ||
uint64 * | nr2 | ||
) |
void my_hash_sort_simple | ( | const CHARSET_INFO * | cs, |
const uchar * | key, | ||
size_t | len, | ||
uint64 * | nr1, | ||
uint64 * | nr2 | ||
) |
uint my_instr_mb | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
size_t | b_length, | ||
const char * | s, | ||
size_t | s_length, | ||
my_match_t * | match, | ||
uint | nmatch | ||
) |
uint my_instr_simple | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
size_t | b_length, | ||
const char * | s, | ||
size_t | s_length, | ||
my_match_t * | match, | ||
uint | nmatch | ||
) |
bool my_is_prefixidx_cand | ( | const CHARSET_INFO * | cs, |
const char * | wildstr, | ||
const char * | wildend, | ||
int | escape, | ||
int | w_many, | ||
size_t * | prefix_len | ||
) |
Identify whether given like pattern looks like a prefix pattern, which can become candidate for index only scan on prefix indexes.
cs | Character set and collation pointer | |
wildstr | Pointer to LIKE pattern. | |
wildend | Pointer to end of LIKE pattern. | |
escape | Escape character pattern, typically '\'. | |
w_many | 'Many characters' pattern, typically ''. | |
[out] | prefix_len | Length of LIKE pattern. |
TRUE | if LIKE pattern can be used for prefix index only scan. |
FALSE | else. |
|
inlinestatic |
|
inlinestatic |
size_t my_lengthsp_8bit | ( | const CHARSET_INFO * | cs, |
const char * | ptr, | ||
size_t | length | ||
) |
bool my_like_range_generic | ( | const CHARSET_INFO * | cs, |
const char * | ptr, | ||
size_t | ptr_length, | ||
char | escape, | ||
char | w_one, | ||
char | w_many, | ||
size_t | res_length, | ||
char * | min_str, | ||
char * | max_str, | ||
size_t * | min_length, | ||
size_t * | max_length | ||
) |
Calculate min_str and max_str that ranges a LIKE string.
Generic function, currently used for ucs2, utf16, utf32, but should be suitable for any other character sets with cs->min_sort_char and cs->max_sort_char represented in Unicode code points.
cs | Character set and collation pointer | |
ptr | Pointer to LIKE pattern. | |
ptr_length | Length of LIKE pattern. | |
escape | Escape character pattern, typically '\'. | |
w_one | 'One character' pattern, typically '_'. | |
w_many | 'Many characters' pattern, typically ''. | |
res_length | Length of min_str and max_str. | |
[out] | min_str | Smallest string that ranges LIKE. |
[out] | max_str | Largest string that ranges LIKE. |
[out] | min_length | Length of min_str |
[out] | max_length | Length of max_str |
false | if LIKE pattern can be optimized |
true | if LIKE can't be optimized. |
bool my_like_range_mb | ( | const CHARSET_INFO * | cs, |
const char * | ptr, | ||
size_t | ptr_length, | ||
char | escape, | ||
char | w_one, | ||
char | w_many, | ||
size_t | res_length, | ||
char * | min_str, | ||
char * | max_str, | ||
size_t * | min_length, | ||
size_t * | max_length | ||
) |
bool my_like_range_simple | ( | const CHARSET_INFO * | cs, |
const char * | ptr, | ||
size_t | ptr_length, | ||
char | escape, | ||
char | w_one, | ||
char | w_many, | ||
size_t | res_length, | ||
char * | min_str, | ||
char * | max_str, | ||
size_t * | min_length, | ||
size_t * | max_length | ||
) |
size_t my_long10_to_str_8bit | ( | const CHARSET_INFO * | cs, |
char * | to, | ||
size_t | l, | ||
int | radix, | ||
long int | val | ||
) |
size_t my_longlong10_to_str_8bit | ( | const CHARSET_INFO * | cs, |
char * | to, | ||
size_t | l, | ||
int | radix, | ||
longlong | val | ||
) |
int my_mb_ctype_8bit | ( | const CHARSET_INFO * | cs, |
int * | ctype, | ||
const uchar * | s, | ||
const uchar * | e | ||
) |
int my_mb_ctype_mb | ( | const CHARSET_INFO * | cs, |
int * | ctype, | ||
const uchar * | s, | ||
const uchar * | e | ||
) |
int my_mb_wc_8bit | ( | const CHARSET_INFO * | cs, |
my_wc_t * | wc, | ||
const uchar * | s, | ||
const uchar * | e | ||
) |
uint my_mbcharlen_8bit | ( | const CHARSET_INFO * | cs, |
uint | c | ||
) |
uint my_mbcharlen_ptr | ( | const CHARSET_INFO * | cs, |
const char * | s, | ||
const char * | e | ||
) |
Get the length of the first code in given sequence of chars.
This func is introduced because we can't determine the length by checking the first byte only for gb18030, so we first try my_mbcharlen, and then my_mbcharlen_2 if necessary to get the length
[in] | cs | charset_info |
[in] | s | start of the char sequence |
[in] | e | end of the char sequence |
size_t my_numcells_8bit | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
const char * | e | ||
) |
size_t my_numcells_mb | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
const char * | e | ||
) |
size_t my_numchars_8bit | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
const char * | e | ||
) |
size_t my_numchars_mb | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
const char * | e | ||
) |
bool my_parse_charset_xml | ( | MY_CHARSET_LOADER * | loader, |
const char * | buf, | ||
size_t | buflen | ||
) |
bool my_propagate_complex | ( | const CHARSET_INFO * | cs, |
const uchar * | str, | ||
size_t | len | ||
) |
bool my_propagate_simple | ( | const CHARSET_INFO * | cs, |
const uchar * | str, | ||
size_t | len | ||
) |
|
inlinestatic |
size_t my_scan_8bit | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
const char * | e, | ||
int | sq | ||
) |
size_t my_snprintf_8bit | ( | const CHARSET_INFO * | cs, |
char * | to, | ||
size_t | n, | ||
const char * | fmt, | ||
... | |||
) |
int my_strcasecmp_8bit | ( | const CHARSET_INFO * | cs, |
const char * | s, | ||
const char * | t | ||
) |
int my_strcasecmp_mb | ( | const CHARSET_INFO * | cs, |
const char * | s, | ||
const char * | t | ||
) |
int my_strcasecmp_mb_bin | ( | const CHARSET_INFO * | cs, |
const char * | s, | ||
const char * | t | ||
) |
size_t my_strcspn | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
const char * | str_end, | ||
const char * | reject, | ||
size_t | reject_length | ||
) |
Calculate the length of the initial segment of 'str' which consists entirely of characters not in 'reject'.
cs | Pointer to charset info. |
str | Pointer to multi-byte string. |
str_end | Pointer to end of multi-byte string. |
reject | Pointer to start of single-byte reject string. |
reject_length | Length of single-byte reject string. |
uint my_string_repertoire | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
size_t | len | ||
) |
int my_strnncoll_mb_bin | ( | const CHARSET_INFO * | cs, |
const uchar * | s, | ||
size_t | slen, | ||
const uchar * | t, | ||
size_t | tlen, | ||
bool | t_is_prefix | ||
) |
int my_strnncoll_simple | ( | const CHARSET_INFO * | cs, |
const uchar * | s, | ||
size_t | slen, | ||
const uchar * | t, | ||
size_t | tlen, | ||
bool | t_is_prefix | ||
) |
int my_strnncollsp_mb_bin | ( | const CHARSET_INFO * | cs, |
const uchar * | a, | ||
size_t | a_length, | ||
const uchar * | b, | ||
size_t | b_length | ||
) |
int my_strnncollsp_simple | ( | const CHARSET_INFO * | cs, |
const uchar * | a, | ||
size_t | a_length, | ||
const uchar * | b, | ||
size_t | b_length | ||
) |
double my_strntod_8bit | ( | const CHARSET_INFO * | cs, |
const char * | s, | ||
size_t | l, | ||
const char ** | e, | ||
int * | err | ||
) |
long my_strntol_8bit | ( | const CHARSET_INFO * | cs, |
const char * | s, | ||
size_t | l, | ||
int | base, | ||
const char ** | e, | ||
int * | err | ||
) |
longlong my_strntoll_8bit | ( | const CHARSET_INFO * | cs, |
const char * | s, | ||
size_t | l, | ||
int | base, | ||
const char ** | e, | ||
int * | err | ||
) |
ulong my_strntoul_8bit | ( | const CHARSET_INFO * | cs, |
const char * | s, | ||
size_t | l, | ||
int | base, | ||
const char ** | e, | ||
int * | err | ||
) |
ulonglong my_strntoull10rnd_8bit | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
size_t | length, | ||
int | unsigned_fl, | ||
const char ** | endptr, | ||
int * | error | ||
) |
ulonglong my_strntoull10rnd_ucs2 | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
size_t | length, | ||
int | unsigned_fl, | ||
char ** | endptr, | ||
int * | error | ||
) |
ulonglong my_strntoull_8bit | ( | const CHARSET_INFO * | cs, |
const char * | s, | ||
size_t | l, | ||
int | base, | ||
const char ** | e, | ||
int * | err | ||
) |
size_t my_strnxfrm_mb | ( | const CHARSET_INFO * | cs, |
uchar * | dst, | ||
size_t | dstlen, | ||
uint | nweights, | ||
const uchar * | src, | ||
size_t | srclen, | ||
uint | flags | ||
) |
size_t my_strnxfrm_simple | ( | const CHARSET_INFO * | cs, |
uchar * | dst, | ||
size_t | dstlen, | ||
uint | nweights, | ||
const uchar * | src, | ||
size_t | srclen, | ||
uint | flags | ||
) |
size_t my_strnxfrm_unicode | ( | const CHARSET_INFO * | cs, |
uchar * | dst, | ||
size_t | dstlen, | ||
uint | nweights, | ||
const uchar * | src, | ||
size_t | srclen, | ||
uint | flags | ||
) |
size_t my_strnxfrm_unicode_full_bin | ( | const CHARSET_INFO * | cs, |
uchar * | dst, | ||
size_t | dstlen, | ||
uint | nweights, | ||
const uchar * | src, | ||
size_t | srclen, | ||
uint | flags | ||
) |
size_t my_strnxfrmlen_simple | ( | const CHARSET_INFO * | cs, |
size_t | len | ||
) |
size_t my_strnxfrmlen_unicode_full_bin | ( | const CHARSET_INFO * | cs, |
size_t | len | ||
) |
longlong my_strtoll10_8bit | ( | const CHARSET_INFO * | cs, |
const char * | nptr, | ||
const char ** | endptr, | ||
int * | error | ||
) |
longlong my_strtoll10_ucs2 | ( | const CHARSET_INFO * | cs, |
const char * | nptr, | ||
char ** | endptr, | ||
int * | error | ||
) |
size_t my_strxfrm_pad | ( | const CHARSET_INFO * | cs, |
uchar * | str, | ||
uchar * | frmend, | ||
uchar * | strend, | ||
uint | nweights, | ||
uint | flags | ||
) |
int my_wc_mb_8bit | ( | const CHARSET_INFO * | cs, |
my_wc_t | wc, | ||
uchar * | s, | ||
uchar * | e | ||
) |
size_t my_well_formed_len_8bit | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
const char * | e, | ||
size_t | pos, | ||
int * | error | ||
) |
size_t my_well_formed_len_mb | ( | const CHARSET_INFO * | cs, |
const char * | b, | ||
const char * | e, | ||
size_t | pos, | ||
int * | error | ||
) |
int my_wildcmp_8bit | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
const char * | str_end, | ||
const char * | wildstr, | ||
const char * | wildend, | ||
int | escape, | ||
int | w_one, | ||
int | w_many | ||
) |
int my_wildcmp_bin | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
const char * | str_end, | ||
const char * | wildstr, | ||
const char * | wildend, | ||
int | escape, | ||
int | w_one, | ||
int | w_many | ||
) |
int my_wildcmp_mb | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
const char * | str_end, | ||
const char * | wildstr, | ||
const char * | wildend, | ||
int | escape, | ||
int | w_one, | ||
int | w_many | ||
) |
int my_wildcmp_mb_bin | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
const char * | str_end, | ||
const char * | wildstr, | ||
const char * | wildend, | ||
int | escape, | ||
int | w_one, | ||
int | w_many | ||
) |
int my_wildcmp_unicode | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
const char * | str_end, | ||
const char * | wildstr, | ||
const char * | wildend, | ||
int | escape, | ||
int | w_one, | ||
int | w_many, | ||
const MY_UNICASE_INFO * | weights | ||
) |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
staticconstexpr |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |