diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-18 09:24:42 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-18 09:24:42 +0300 |
commit | 1e82ed1f1bcee42807614a8feae289f619d9fb99 (patch) | |
tree | afd22ba83fe843297c51b36302341dbf9654aac2 | |
parent | 8159d8d0fc5362f29dc7a0950ff3b73a83f874ed (diff) | |
parent | bcb5ba8f3c3b955f0b83590c7098df5d98c1c01f (diff) | |
download | mariadb-git-bb-10.4-merge2.tar.gz |
Merge bb-10.4-mergebb-10.4-merge2
-rw-r--r-- | sql/sql_type.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 72514273ae2..f6aabb97333 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -8341,6 +8341,15 @@ Charset::encoding_allows_reinterpret_as(const CHARSET_INFO *cs) const bool Charset::encoding_and_order_allow_reinterpret_as(CHARSET_INFO *cs) const { + /* + Test quickly if we have two exactly equal CHARSET_INFO pointers. + This also handles a special case with my_charset_bin: + it does not have a collation name specific part in CHARSET_INFO::name, + which is just "binary" (without a character set name prefix), + so the code with collation_specific_name() below won't work for it. + */ + if (m_charset == cs) + return true; if (!encoding_allows_reinterpret_as(cs)) return false; LEX_CSTRING name0= collation_specific_name(); |