From c0dec39da04d68b49fbab51eb87bd81df70d6d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 24 May 2017 15:20:35 +0300 Subject: [PATCH] fts_is_charset_cjk(): Do not call strcmp() Remove a bogus reference to gb18030_chinese_ci, which was introduced in MySQL 5.7. It is roughly equivalent to utf8mb4_unicode_ci, just using a different internal encoding, and different collation. --- storage/innobase/include/fts0types.ic | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/storage/innobase/include/fts0types.ic b/storage/innobase/include/fts0types.ic index 417a1010919aa..a8712751412a8 100644 --- a/storage/innobase/include/fts0types.ic +++ b/storage/innobase/include/fts0types.ic @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -115,19 +116,14 @@ bool fts_is_charset_cjk( const CHARSET_INFO* cs) { - if (strcmp(cs->name, "gb2312_chinese_ci") == 0 - || strcmp(cs->name, "gbk_chinese_ci") == 0 - || strcmp(cs->name, "big5_chinese_ci") == 0 - || strcmp(cs->name, "gb18030_chinese_ci") == 0 - || strcmp(cs->name, "ujis_japanese_ci") == 0 - || strcmp(cs->name, "sjis_japanese_ci") == 0 - || strcmp(cs->name, "cp932_japanese_ci") == 0 - || strcmp(cs->name, "eucjpms_japanese_ci") == 0 - || strcmp(cs->name, "euckr_korean_ci") == 0) { - return(true); - } else { - return(false); - } + return cs == &my_charset_gb2312_chinese_ci + || cs == &my_charset_gbk_chinese_ci + || cs == &my_charset_big5_chinese_ci + || cs == &my_charset_ujis_japanese_ci + || cs == &my_charset_sjis_japanese_ci + || cs == &my_charset_cp932_japanese_ci + || cs == &my_charset_eucjpms_japanese_ci + || cs == &my_charset_euckr_korean_ci; } /** Select the FTS auxiliary index for the given character by range.