diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2023-05-17 14:58:11 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2023-05-17 14:58:11 +0200 |
commit | 2543673dd22782f59299fd2e72179601892bd967 (patch) | |
tree | b73641bd88c9d1572203c75da618fce1937518e8 /include/m_ctype.h | |
parent | 4e5b771e980edfdad5c5414aa62c81d409d585a4 (diff) | |
parent | ef911553f442cbb1baaac2af44c38b54fd058c41 (diff) | |
download | mariadb-git-2543673dd22782f59299fd2e72179601892bd967.tar.gz |
Merge branch '11.0' into 11.1bb-11.1-release
Diffstat (limited to 'include/m_ctype.h')
-rw-r--r-- | include/m_ctype.h | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index 708107ff120..6812445c6d5 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -79,7 +79,6 @@ extern "C" { typedef const struct my_charset_handler_st MY_CHARSET_HANDLER; typedef const struct my_collation_handler_st MY_COLLATION_HANDLER; -typedef const struct unicase_info_st MY_UNICASE_INFO; typedef const struct casefold_info_st MY_CASEFOLD_INFO; typedef const struct uni_ctype_st MY_UNI_CTYPE; typedef const struct my_uni_idx_st MY_UNI_IDX; @@ -97,29 +96,10 @@ struct casefold_info_st { my_wc_t maxchar; const MY_CASEFOLD_CHARACTER * const *page; + const uint16 * const *simple_weight; /* For general_ci-alike collations */ }; -typedef struct unicase_info_char_st -{ - uint32 toupper; - uint32 tolower; - uint32 sort; -} MY_UNICASE_CHARACTER; - - -struct unicase_info_st -{ - my_wc_t maxchar; - MY_UNICASE_CHARACTER **page; -}; - - -extern MY_UNICASE_INFO my_unicase_default; -extern MY_UNICASE_INFO my_unicase_turkish; -extern MY_UNICASE_INFO my_unicase_mysql500; -extern MY_UNICASE_INFO my_unicase_unicode520; - #define MY_UCA_MAX_CONTRACTION 6 /* The DUCET tables in ctype-uca.c are dumped with a limit of 8 weights @@ -391,6 +371,28 @@ typedef enum enum_collation_name_mode #define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */ #define MY_STRXFRM_REVERSE_SHIFT 16 +/* Flags to strnncollsp_nchars */ +/* + MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES - + defines if inside strnncollsp_nchars() + short strings should be virtually extended to "nchars" + characters by emulating trimmed trailing spaces. + + This flag is needed when comparing packed strings of the CHAR + data type, when trailing spaces are trimmed on storage (like in InnoDB), + however the actual values (after unpacking) will have those trailing + spaces. + + If this flag is passed, strnncollsp_nchars() performs both + truncating longer strings and extending shorter strings + to exactly "nchars". + + If this flag is not passed, strnncollsp_nchars() only truncates longer + strings to "nchars", but does not extend shorter strings to "nchars". +*/ +#define MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES 1 + + /* Collation IDs for MariaDB that should not conflict with MySQL. We reserve 256..511, because MySQL will most likely use this range @@ -526,7 +528,8 @@ struct my_collation_handler_st int (*strnncollsp_nchars)(CHARSET_INFO *, const uchar *str1, size_t len1, const uchar *str2, size_t len2, - size_t nchars); + size_t nchars, + uint flags); size_t (*strnxfrm)(CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags); @@ -772,7 +775,6 @@ struct charset_info_st const uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; MY_CASEFOLD_INFO *casefold; - MY_UNICASE_INFO *caseinfo; const uchar *state_map; const uchar *ident_map; uint strxfrm_multiply; @@ -1668,7 +1670,7 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many, - MY_UNICASE_INFO *weights); + MY_CASEFOLD_INFO *weights); extern my_bool my_parse_charset_xml(MY_CHARSET_LOADER *loader, const char *buf, size_t buflen); |