summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-05-18 07:26:56 +0400
committerAlexander Barkov <bar@mariadb.com>2019-05-18 07:26:56 +0400
commitd9f392848afc72fdf12c8f6c525e93435c683283 (patch)
treed6ef14fdeafc529058f2793fff22c066c988b51d
parentb86175747df2e185d8bbe235e1a314f8d1848a6c (diff)
downloadmariadb-git-d9f392848afc72fdf12c8f6c525e93435c683283.tar.gz
A cleanup for MDEV-19284, MDEV-19285
Fixing a test failure tokudb.change_column_varbin_descriptor
-rw-r--r--sql/sql_type.cc9
1 files changed, 9 insertions, 0 deletions
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();