diff options
author | Alexander Barkov <bar@mariadb.org> | 2014-09-04 21:58:48 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2014-09-04 21:58:48 +0400 |
commit | 9392d0e280c622c56d1b533762d8b577ed5b82c6 (patch) | |
tree | 11dc8978b370ead259ae9eaa419e2a2710feaf73 /include | |
parent | bf4347eba07a7e8f11af07a684381d48d673e028 (diff) | |
download | mariadb-git-9392d0e280c622c56d1b533762d8b577ed5b82c6.tar.gz |
- MDEV-6695 Bad column name for UCS2 string literals
The Item_string constructors called set_name() on the source string,
which was wrong because in case of UCS2/UTF16/UTF32 the source value
might be a not well formed string (e.g. have incomplete leftmost character).
Now set_name() is called on str_value after its copied
(with optionally left zero padding) from the source string.
- MDEV-6694 Illegal mix of collation with a PS parameter
Item_param::convert_str_value() did not set repertoire.
Introducing a new structure MY_STRING_METADATA to collect
character length and repertoire of a string in a single loop,
to avoid two separate loops. Adding a new class Item_basic_value::Metadata
as a convenience wrapper around MY_STRING_METADATA, to reuse the
code between Item_string and Item_param.
Diffstat (limited to 'include')
-rw-r--r-- | include/m_ctype.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index 6f372002ebb..5994816cbfc 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -735,6 +735,14 @@ my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len); my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len); +typedef struct +{ + size_t char_length; + uint repertoire; +} MY_STRING_METADATA; + +void my_string_metadata_get(MY_STRING_METADATA *metadata, + CHARSET_INFO *cs, const char *str, size_t len); uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len); my_bool my_charset_is_ascii_based(CHARSET_INFO *cs); my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); |