diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2020-11-27 22:06:54 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2020-11-27 22:20:49 +0530 |
commit | fa17c8b9c0a51525160c5adeefa9d68c1d3f3a4c (patch) | |
tree | 5f8bfc4ab888064f15defef93329dcea7f4d05e1 /sql/sql_string.h | |
parent | 08b0b70daa43a539d911238e25998f7450bab9e6 (diff) | |
download | mariadb-git-bb-10.3-21265.tar.gz |
MDEV-21265: IN predicate conversion to IN subquery should be allowed for a broader set of datatype comparisonbb-10.3-21265
Allow materialization strategy when collations on the
inner and outer sides of an IN subquery are the same and the
character set of the inner side is a proper subset of the character
set on the outer side.
This allows conversion from utf8mb3 to utf8mb4
as the former is a subset of the later.
This is only allowed when IN predicate is converted to an IN subquery
Backported part of the patch (d6a00d9b18f) of MDEV-17905.
Diffstat (limited to 'sql/sql_string.h')
-rw-r--r-- | sql/sql_string.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/sql_string.h b/sql/sql_string.h index 11c3f0cd573..4f9a68acbb4 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -131,6 +131,24 @@ uint convert_to_printable(char *to, size_t to_len, const char *from, size_t from_len, CHARSET_INFO *from_cs, size_t nbytes= 0); +class Charset +{ + CHARSET_INFO *m_charset; +public: + Charset() :m_charset(&my_charset_bin) { } + Charset(CHARSET_INFO *cs) :m_charset(cs) { } + + CHARSET_INFO *charset() const { return m_charset; } + /* + Collation name without the character set name. + For example, in case of "latin1_swedish_ci", + this method returns "_swedish_ci". + */ + LEX_CSTRING collation_specific_name() const; + bool encoding_allows_reinterpret_as(CHARSET_INFO *cs) const; + bool eq_collation_specific_names(CHARSET_INFO *cs) const; +}; + class String : public Sql_alloc { char *Ptr; |