MySQL 8.0.39
Source Code Documentation
|
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <algorithm>
#include "m_ctype.h"
#include "m_string.h"
#include "my_byteorder.h"
#include "my_inttypes.h"
#include "my_loglevel.h"
#include "my_macros.h"
#include "my_xml.h"
#include "mysys_err.h"
Classes | |
struct | my_cs_file_section_st |
struct | my_cs_file_info |
Typedefs | |
typedef struct my_cs_file_info | MY_CHARSET_FILE |
Functions | |
static char * | mstr (char *str, const char *src, size_t l1, size_t l2) |
static struct my_cs_file_section_st * | cs_file_sec (const char *attr, size_t len) |
static void | my_charset_file_reset_charset (MY_CHARSET_FILE *i) |
static void | my_charset_file_reset_collation (MY_CHARSET_FILE *i) |
static void | my_charset_file_init (MY_CHARSET_FILE *i) |
static void | my_charset_file_free (MY_CHARSET_FILE *i) |
static int | my_charset_file_tailoring_realloc (MY_CHARSET_FILE *i, size_t newlen) |
static int | fill_uchar (uchar *a, uint size, const char *str, size_t len) |
static int | fill_uint16 (uint16 *a, uint size, const char *str, size_t len) |
static int | tailoring_append (MY_XML_PARSER *st, const char *fmt, size_t len, const char *attr) |
static int | tailoring_append2 (MY_XML_PARSER *st, const char *fmt, size_t len1, const char *attr1, size_t len2, const char *attr2) |
static size_t | scan_one_character (const char *s, const char *e, my_wc_t *wc) |
static int | tailoring_append_abbreviation (MY_XML_PARSER *st, const char *fmt, size_t len, const char *attr) |
static int | cs_enter (MY_XML_PARSER *st, const char *attr, size_t len) |
static int | cs_leave (MY_XML_PARSER *st, const char *attr, size_t len) |
static int | cs_value (MY_XML_PARSER *st, const char *attr, size_t len) |
bool | my_parse_charset_xml (MY_CHARSET_LOADER *loader, const char *buf, size_t len) |
uint | my_string_repertoire (const CHARSET_INFO *cs, const char *str, size_t length) |
uint | my_charset_repertoire (const CHARSET_INFO *cs) |
bool | my_charset_is_8bit_pure_ascii (const CHARSET_INFO *cs) |
bool | my_charset_is_ascii_compatible (const CHARSET_INFO *cs) |
static size_t | my_convert_internal (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... | |
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... | |
Variables | |
int(* | my_string_stack_guard )(int) = nullptr |
static struct my_cs_file_section_st | sec [] |
static const char * | diff_fmt [5] |
static const char * | context_diff_fmt [5] |
#define _CS_A_DIFF1 351 |
#define _CS_A_DIFF2 352 |
#define _CS_A_DIFF3 353 |
#define _CS_A_DIFF4 354 |
#define _CS_A_IDENTICAL 355 |
#define _CS_BINARY_ID 16 |
#define _CS_CHARSET 8 |
#define _CS_CL_OPTIMIZE 102 |
#define _CS_CL_SHIFT_AFTER_METHOD 103 |
#define _CS_CL_SUPPRESS_CONTRACTIONS 101 |
#define _CS_COLLATION 9 |
#define _CS_COLLMAP 13 |
#define _CS_COLNAME 6 |
#define _CS_CONTEXT 370 |
#define _CS_CSDESCRIPT 17 |
#define _CS_CSNAME 3 |
#define _CS_CTYPEMAP 14 |
#define _CS_DIFF1 302 |
#define _CS_DIFF2 303 |
#define _CS_DIFF3 304 |
#define _CS_DIFF4 305 |
#define _CS_EXP_DIFF1 322 |
#define _CS_EXP_DIFF2 323 |
#define _CS_EXP_DIFF3 324 |
#define _CS_EXP_DIFF4 325 |
#define _CS_EXP_EXTEND 321 |
#define _CS_EXP_IDENTICAL 326 |
#define _CS_EXP_X 320 |
#define _CS_FAMILY 4 |
#define _CS_FLAG 7 |
#define _CS_ID 2 |
#define _CS_IDENTICAL 306 |
#define _CS_LOWERMAP 11 |
#define _CS_MISC 1 |
#define _CS_ORDER 5 |
#define _CS_PRIMARY_ID 15 |
#define _CS_RESET 301 |
#define _CS_RESET_BEFORE 380 |
#define _CS_RESET_FIRST_NON_IGNORABLE 411 |
#define _CS_RESET_FIRST_PRIMARY_IGNORABLE 401 |
#define _CS_RESET_FIRST_SECONDARY_IGNORABLE 403 |
#define _CS_RESET_FIRST_TERTIARY_IGNORABLE 405 |
#define _CS_RESET_FIRST_TRAILING 407 |
#define _CS_RESET_FIRST_VARIABLE 409 |
#define _CS_RESET_LAST_NON_IGNORABLE 412 |
#define _CS_RESET_LAST_PRIMARY_IGNORABLE 402 |
#define _CS_RESET_LAST_SECONDARY_IGNORABLE 404 |
#define _CS_RESET_LAST_TERTIARY_IGNORABLE 406 |
#define _CS_RESET_LAST_TRAILING 408 |
#define _CS_RESET_LAST_VARIABLE 410 |
#define _CS_RULES 300 |
#define _CS_ST_ALTERNATE 202 |
#define _CS_ST_BACKWARDS 203 |
#define _CS_ST_CASE_FIRST 206 |
#define _CS_ST_CASE_LEVEL 205 |
#define _CS_ST_HIRAGANA_QUATERNARY 207 |
#define _CS_ST_MATCH_BOUNDARIES 210 |
#define _CS_ST_MATCH_STYLE 211 |
#define _CS_ST_NORMALIZATION 204 |
#define _CS_ST_NUMERIC 208 |
#define _CS_ST_SETTINGS 200 |
#define _CS_ST_STRENGTH 201 |
#define _CS_ST_VARIABLE_TOP 209 |
#define _CS_UCA_VERSION 100 |
#define _CS_UNIMAP 12 |
#define _CS_UPPERMAP 10 |
#define MY_CS_CONTEXT_SIZE 64 |
#define MY_CS_CSDESCR_SIZE 64 |
typedef struct my_cs_file_info MY_CHARSET_FILE |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
bool my_charset_is_8bit_pure_ascii | ( | const CHARSET_INFO * | cs | ) |
bool my_charset_is_ascii_compatible | ( | const CHARSET_INFO * | cs | ) |
uint my_charset_repertoire | ( | 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.
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 |
|
static |
Convert a string between two character sets.
'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 |
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. |
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 |
bool my_parse_charset_xml | ( | MY_CHARSET_LOADER * | loader, |
const char * | buf, | ||
size_t | len | ||
) |
uint my_string_repertoire | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
size_t | length | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int(* my_string_stack_guard) (int) | ( | int | ) | = nullptr |
|
static |