From d9f392848afc72fdf12c8f6c525e93435c683283 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 18 May 2019 07:26:56 +0400 Subject: A cleanup for MDEV-19284, MDEV-19285 Fixing a test failure tokudb.change_column_varbin_descriptor --- sql/sql_type.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sql/sql_type.cc b/sql/sql_type.cc index e100e427068..5a6b7876a1c 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -8287,6 +8287,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(); -- cgit v1.2.1