mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-21265: IN predicate conversion to IN subquery should be allowed for a broader set of datatype comparison
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 (d6a00d9b18
) of MDEV-17905.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user