diff options
author | Alexander Barkov <bar@mariadb.org> | 2015-08-14 18:34:41 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2015-08-14 18:34:41 +0400 |
commit | 78b80cb6baa3f9c4e58355888e8c6defab186440 (patch) | |
tree | 70eb8bf0de64d49f7bb27cd89b54070ce9564588 /include | |
parent | bfb6ea02321f963c2b5f5beb333283585d3d1be3 (diff) | |
download | mariadb-git-78b80cb6baa3f9c4e58355888e8c6defab186440.tar.gz |
Adding MY_CHARSET_HANDLER::native_to_mb().
This is a pre-requisite patch for:
- MDEV-8433 Make field<'broken-string' use indexes
- MDEV-8625 Bad result set with ignorable characters when using a prefix key
- MDEV-8626 Bad result set with contractions when using a prefix key
Diffstat (limited to 'include')
-rw-r--r-- | include/m_ctype.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index 9db8fca12b3..c5be24bb063 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -511,6 +511,20 @@ struct my_charset_handler_st char *dst, size_t dst_length, const char *src, size_t src_length, size_t nchars, MY_STRCOPY_STATUS *status); + /** + Write a character to the target string, using its native code. + For Unicode character sets (utf8, ucs2, utf16, utf16le, utf32, filename) + native codes are equvalent to Unicode code points. + For 8bit character sets the native code is just the byte value. + For Asian characters sets: + - MB1 native code is just the byte value (e.g. on the ASCII range) + - MB2 native code is ((b0 << 8) + b1). + - MB3 native code is ((b0 <<16) + (b1 << 8) + b2) + Note, CHARSET_INFO::min_sort_char and CHARSET_INFO::max_sort_char + are defined in native notation and should be written using + cs->cset->native_to_mb() rather than cs->cset->wc_mb(). + */ + my_charset_conv_wc_mb native_to_mb; }; extern MY_CHARSET_HANDLER my_charset_8bit_handler; @@ -664,6 +678,7 @@ extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *); int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e); int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e); +int my_wc_mb_bin(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e); int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *); int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *); |