MySQL 9.1.0
Source Code Documentation
|
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <memory>
#include "my_byteorder.h"
#include "my_sys.h"
#include "my_xml.h"
#include "mysql/my_loglevel.h"
#include "mysql/strings/collations.h"
#include "mysql/strings/m_ctype.h"
#include "mysys_err.h"
#include "sql_chars.h"
#include "strings/collations_internal.h"
#include "strings/m_ctype_internals.h"
#include "template_utils.h"
Classes | |
struct | my_cs_file_section_st |
struct | my_cs_file_info |
Typedefs | |
typedef struct my_cs_file_info | MY_CHARSET_FILE |
Functions | |
template<size_t N> | |
bool | starts_with (std::string name, const char(&prefix)[N]) |
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 (uint8_t *a, unsigned size, const char *str, size_t len) |
static int | fill_uint16 (uint16_t *a, unsigned 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, MY_CHARSET_ERRMSG *errmsg) |
unsigned | my_string_repertoire (const CHARSET_INFO *cs, const char *str, size_t length) |
unsigned | 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, unsigned *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, unsigned *errors) |
Convert a string between two character sets. More... | |
unsigned | 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 void * | once_memdup (MY_CHARSET_LOADER *loader, const void *from, size_t size) |
static const char * | once_strdup (MY_CHARSET_LOADER *loader, const char *from) |
static void | simple_cs_init_functions (CHARSET_INFO *cs) |
static bool | cs_copy_data (MY_CHARSET_LOADER *loader, CHARSET_INFO *to, CHARSET_INFO *from) |
static bool | simple_cs_is_full (CHARSET_INFO *cs) |
static void | copy_uca_collation (CHARSET_INFO *to, CHARSET_INFO *from) |
static void | clear_cs_info (CHARSET_INFO *cs) |
Variables | |
CHARSET_INFO | my_charset_ucs2_unicode_ci |
CHARSET_INFO | my_charset_utf16_unicode_ci |
CHARSET_INFO | my_charset_utf8mb4_unicode_ci |
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 |
|
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 | ) |
unsigned 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, | ||
unsigned * | 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. |
unsigned 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, | ||
MY_CHARSET_ERRMSG * | errmsg | ||
) |
unsigned my_string_repertoire | ( | const CHARSET_INFO * | cs, |
const char * | str, | ||
size_t | length | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
bool starts_with | ( | std::string | name, |
const char(&) | prefix[N] | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
extern |
|
extern |
|
extern |
|
static |