Skip to content

Commit

Permalink
fts_is_charset_cjk(): Do not call strcmp()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed May 26, 2017
1 parent e54d521 commit c0dec39
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions 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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c0dec39

Please sign in to comment.