MySQL 8.0.40
Source Code Documentation
|
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#include <algorithm>
#include "m_ctype.h"
#include "m_string.h"
#include "my_byteorder.h"
#include "my_compiler.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "template_utils.h"
Macros | |
#define | EILSEQ ENOENT |
#define | ULONGLONG_MAX (~(ulonglong)0) |
#define | MAX_NEGATIVE_NUMBER ((ulonglong)0x8000000000000000LL) |
#define | INIT_CNT 9 |
#define | LFACTOR 1000000000ULL |
#define | LFACTOR1 10000000000ULL |
#define | LFACTOR2 100000000000ULL |
#define | MY_UTF16_SURROGATE_HIGH_FIRST 0xD800 |
#define | MY_UTF16_SURROGATE_LOW_FIRST 0xDC00 |
#define | MY_UTF16_SURROGATE_LOW_LAST 0xDFFF |
#define | MY_UTF16_HIGH_HEAD(x) ((((uchar)(x)) & 0xFC) == 0xD8) |
#define | MY_UTF16_LOW_HEAD(x) ((((uchar)(x)) & 0xFC) == 0xDC) |
#define | MY_UTF16_SURROGATE(x) (((x)&0xF800) == 0xD800) |
#define | MY_UTF16_WC2(a, b) ((a << 8) + b) |
#define | MY_UTF16_WC4(a, b, c, d) (((a & 3) << 18) + (b << 10) + ((c & 3) << 8) + d + 0x10000) |
Functions | |
static longlong | ulonglong_with_sign (bool negative, ulonglong ll) |
static int | my_bincmp (const uchar *s, const uchar *se, const uchar *t, const uchar *te) |
static size_t | my_caseup_str_mb2_or_mb4 (const CHARSET_INFO *cs, char *s) |
static size_t | my_casedn_str_mb2_or_mb4 (const CHARSET_INFO *cs, char *s) |
static int | my_strcasecmp_mb2_or_mb4 (const CHARSET_INFO *cs, const char *s, const char *t) |
static long | my_strntol_mb2_or_mb4 (const CHARSET_INFO *cs, const char *nptr, size_t l, int base, const char **endptr, int *err) |
static ulong | my_strntoul_mb2_or_mb4 (const CHARSET_INFO *cs, const char *nptr, size_t l, int base, const char **endptr, int *err) |
static longlong | my_strntoll_mb2_or_mb4 (const CHARSET_INFO *cs, const char *nptr, size_t l, int base, const char **endptr, int *err) |
static ulonglong | my_strntoull_mb2_or_mb4 (const CHARSET_INFO *cs, const char *nptr, size_t l, int base, const char **endptr, int *err) |
static double | my_strntod_mb2_or_mb4 (const CHARSET_INFO *cs, const char *nptr, size_t length, const char **endptr, int *err) |
static ulonglong | my_strntoull10rnd_mb2_or_mb4 (const CHARSET_INFO *cs, const char *nptr, size_t length, int unsign_fl, const char **endptr, int *err) |
static size_t | my_l10tostr_mb2_or_mb4 (const CHARSET_INFO *cs, char *dst, size_t len, int radix, long int val) |
static size_t | my_ll10tostr_mb2_or_mb4 (const CHARSET_INFO *cs, char *dst, size_t len, int radix, longlong val) |
static longlong | my_strtoll10_mb2 (const CHARSET_INFO *cs, const char *nptr, const char **endptr, int *error) |
static size_t | my_scan_mb2 (const CHARSET_INFO *cs, const char *str, const char *end, int sequence_type) |
static void | my_fill_mb2 (const CHARSET_INFO *cs, char *s, size_t slen, int fill) |
static size_t | my_vsnprintf_mb2 (char *dst, size_t n, const char *fmt, va_list ap) |
static size_t | my_snprintf_mb2 (const CHARSET_INFO *cs, char *to, size_t n, const char *fmt,...) |
static size_t | my_lengthsp_mb2 (const CHARSET_INFO *cs, const char *ptr, size_t length) |
static int | my_utf16_uni (const CHARSET_INFO *cs, my_wc_t *pwc, const uchar *s, const uchar *e) |
static int | my_uni_utf16 (const CHARSET_INFO *cs, my_wc_t wc, uchar *s, uchar *e) |
static void | my_tolower_utf16 (const MY_UNICASE_INFO *uni_plane, my_wc_t *wc) |
static void | my_toupper_utf16 (const MY_UNICASE_INFO *uni_plane, my_wc_t *wc) |
static void | my_tosort_utf16 (const MY_UNICASE_INFO *uni_plane, my_wc_t *wc) |
static size_t | my_caseup_utf16 (const CHARSET_INFO *cs, char *src, size_t srclen, char *dst, size_t dstlen) |
static void | my_hash_sort_utf16 (const CHARSET_INFO *cs, const uchar *s, size_t slen, uint64 *n1, uint64 *n2) |
static size_t | my_casedn_utf16 (const CHARSET_INFO *cs, char *src, size_t srclen, char *dst, size_t dstlen) |
static int | my_strnncoll_utf16 (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, bool t_is_prefix) |
static int | my_strnncollsp_utf16 (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen) |
Compare strings, discarding end space. More... | |
static uint | my_ismbchar_utf16 (const CHARSET_INFO *cs, const char *b, const char *e) |
static uint | my_mbcharlen_utf16 (const CHARSET_INFO *cs, uint c) |
static size_t | my_numchars_utf16 (const CHARSET_INFO *cs, const char *b, const char *e) |
static size_t | my_charpos_utf16 (const CHARSET_INFO *cs, const char *b, const char *e, size_t pos) |
static size_t | my_well_formed_len_utf16 (const CHARSET_INFO *cs, const char *b, const char *e, size_t nchars, int *error) |
static int | my_wildcmp_utf16_ci (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) |
static int | my_wildcmp_utf16_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) |
static int | my_strnncoll_utf16_bin (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, bool t_is_prefix) |
static int | my_strnncollsp_utf16_bin (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen) |
static void | my_hash_sort_utf16_bin (const CHARSET_INFO *cs, const uchar *pos, size_t len, uint64 *nr1, uint64 *nr2) |
static int | my_utf16le_uni (const CHARSET_INFO *cs, my_wc_t *pwc, const uchar *s, const uchar *e) |
static int | my_uni_utf16le (const CHARSET_INFO *cs, my_wc_t wc, uchar *s, uchar *e) |
static size_t | my_lengthsp_utf16le (const CHARSET_INFO *cs, const char *ptr, size_t length) |
static int | my_utf32_uni (const CHARSET_INFO *cs, my_wc_t *pwc, const uchar *s, const uchar *e) |
static int | my_uni_utf32 (const CHARSET_INFO *cs, my_wc_t wc, uchar *s, uchar *e) |
static void | my_tolower_utf32 (const MY_UNICASE_INFO *uni_plane, my_wc_t *wc) |
static void | my_toupper_utf32 (const MY_UNICASE_INFO *uni_plane, my_wc_t *wc) |
static void | my_tosort_utf32 (const MY_UNICASE_INFO *uni_plane, my_wc_t *wc) |
static size_t | my_caseup_utf32 (const CHARSET_INFO *cs, char *src, size_t srclen, char *dst, size_t dstlen) |
static void | my_hash_sort_utf32 (const CHARSET_INFO *cs, const uchar *s, size_t slen, uint64 *n1, uint64 *n2) |
static size_t | my_casedn_utf32 (const CHARSET_INFO *cs, char *src, size_t srclen, char *dst, size_t dstlen) |
static int | my_strnncoll_utf32 (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, bool t_is_prefix) |
static int | my_strnncollsp_utf32 (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen) |
Compare strings, discarding end space. More... | |
static size_t | my_strnxfrmlen_utf32 (const CHARSET_INFO *cs, size_t len) |
static uint | my_ismbchar_utf32 (const CHARSET_INFO *cs, const char *b, const char *e) |
static uint | my_mbcharlen_utf32 (const CHARSET_INFO *cs, uint c) |
static size_t | my_vsnprintf_utf32 (char *dst, size_t n, const char *fmt, va_list ap) |
static size_t | my_snprintf_utf32 (const CHARSET_INFO *cs, char *to, size_t n, const char *fmt,...) |
static longlong | my_strtoll10_utf32 (const CHARSET_INFO *cs, const char *nptr, const char **endptr, int *error) |
static size_t | my_numchars_utf32 (const CHARSET_INFO *cs, const char *b, const char *e) |
static size_t | my_charpos_utf32 (const CHARSET_INFO *cs, const char *b, const char *e, size_t pos) |
static size_t | my_well_formed_len_utf32 (const CHARSET_INFO *cs, const char *b, const char *e, size_t nchars, int *error) |
static void | my_fill_utf32 (const CHARSET_INFO *cs, char *s, size_t slen, int fill) |
static size_t | my_lengthsp_utf32 (const CHARSET_INFO *cs, const char *ptr, size_t length) |
static int | my_wildcmp_utf32_ci (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) |
static int | my_wildcmp_utf32_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) |
static int | my_strnncoll_utf32_bin (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, bool t_is_prefix) |
static my_wc_t | my_utf32_get (const uchar *s) |
static int | my_strnncollsp_utf32_bin (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen) |
static size_t | my_scan_utf32 (const CHARSET_INFO *cs, const char *str, const char *end, int sequence_type) |
static int | my_ucs2_uni (const CHARSET_INFO *cs, my_wc_t *pwc, const uchar *s, const uchar *e) |
static int | my_uni_ucs2 (const CHARSET_INFO *cs, my_wc_t wc, uchar *r, uchar *e) |
static void | my_tolower_ucs2 (const MY_UNICASE_INFO *uni_plane, my_wc_t *wc) |
static void | my_toupper_ucs2 (const MY_UNICASE_INFO *uni_plane, my_wc_t *wc) |
static void | my_tosort_ucs2 (const MY_UNICASE_INFO *uni_plane, my_wc_t *wc) |
static size_t | my_caseup_ucs2 (const CHARSET_INFO *cs, char *src, size_t srclen, char *dst, size_t dstlen) |
static void | my_hash_sort_ucs2 (const CHARSET_INFO *cs, const uchar *s, size_t slen, uint64 *n1, uint64 *n2) |
static size_t | my_casedn_ucs2 (const CHARSET_INFO *cs, char *src, size_t srclen, char *dst, size_t dstlen) |
static void | my_fill_ucs2 (const CHARSET_INFO *cs, char *s, size_t l, int fill) |
static int | my_strnncoll_ucs2 (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, bool t_is_prefix) |
static int | my_strnncollsp_ucs2 (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen) |
static uint | my_ismbchar_ucs2 (const CHARSET_INFO *cs, const char *b, const char *e) |
static uint | my_mbcharlen_ucs2 (const CHARSET_INFO *cs, uint c) |
static size_t | my_numchars_ucs2 (const CHARSET_INFO *cs, const char *b, const char *e) |
static size_t | my_charpos_ucs2 (const CHARSET_INFO *cs, const char *b, const char *e, size_t pos) |
static size_t | my_well_formed_len_ucs2 (const CHARSET_INFO *cs, const char *b, const char *e, size_t nchars, int *error) |
static int | my_wildcmp_ucs2_ci (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) |
static int | my_wildcmp_ucs2_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) |
static int | my_strnncoll_ucs2_bin (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, bool t_is_prefix) |
static int | my_strnncollsp_ucs2_bin (const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen) |
static void | my_hash_sort_ucs2_bin (const CHARSET_INFO *cs, const uchar *key, size_t len, uint64 *nr1, uint64 *nr2) |
#define EILSEQ ENOENT |
#define INIT_CNT 9 |
#define LFACTOR 1000000000ULL |
#define LFACTOR1 10000000000ULL |
#define LFACTOR2 100000000000ULL |
#define MAX_NEGATIVE_NUMBER ((ulonglong)0x8000000000000000LL) |
#define MY_UTF16_HIGH_HEAD | ( | x | ) | ((((uchar)(x)) & 0xFC) == 0xD8) |
#define MY_UTF16_LOW_HEAD | ( | x | ) | ((((uchar)(x)) & 0xFC) == 0xDC) |
#define MY_UTF16_SURROGATE | ( | x | ) | (((x)&0xF800) == 0xD800) |
#define MY_UTF16_SURROGATE_HIGH_FIRST 0xD800 |
#define MY_UTF16_SURROGATE_LOW_FIRST 0xDC00 |
#define MY_UTF16_SURROGATE_LOW_LAST 0xDFFF |
#define MY_UTF16_WC2 | ( | a, | |
b | |||
) | ((a << 8) + b) |
#define MY_UTF16_WC4 | ( | a, | |
b, | |||
c, | |||
d | |||
) | (((a & 3) << 18) + (b << 10) + ((c & 3) << 8) + d + 0x10000) |
#define ULONGLONG_MAX (~(ulonglong)0) |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Compare strings, discarding end space.
If one string is shorter as the other, then we space extend the other so that the strings have equal length.
This will ensure that the following things hold:
"a" == "a " "a\0" < "a" "a\0" < "a "
cs | Character set pinter. |
s | First string to compare. |
slen | Length of 's'. |
t | Second string to compare. |
tlen | Length of 't'. |
IMPLEMENTATION
Negative | number, if a less than b. |
0,if | a is equal to b |
Positive | number, if a > b |
|
static |
|
static |
Compare strings, discarding end space.
If one string is shorter as the other, then we space extend the other so that the strings have equal length.
This will ensure that the following things hold:
"a" == "a " "a\0" < "a" "a\0" < "a "
cs | Character set pinter. |
s | First string to compare. |
slen | Length of 's'. |
t | Second string to compare. |
tlen | Length of 't'. |
IMPLEMENTATION
Negative | number, if a less than b. |
0,if | a is equal to b |
Positive | number, if a > b |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
CHARSET_INFO my_charset_ucs2_bin |
CHARSET_INFO my_charset_ucs2_general_ci |
CHARSET_INFO my_charset_ucs2_general_mysql500_ci |
MY_CHARSET_HANDLER my_charset_ucs2_handler |
CHARSET_INFO my_charset_utf16_bin |
CHARSET_INFO my_charset_utf16_general_ci |
MY_CHARSET_HANDLER my_charset_utf16_handler |
CHARSET_INFO my_charset_utf16le_bin |
CHARSET_INFO my_charset_utf16le_general_ci |
|
static |
CHARSET_INFO my_charset_utf32_bin |
CHARSET_INFO my_charset_utf32_general_ci |
MY_CHARSET_HANDLER my_charset_utf32_handler |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |