diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-12 13:30:40 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-12 13:30:40 +0200 |
commit | 91173f986373e4f5f134a2351a80d8763e5157e8 (patch) | |
tree | 8a863bc007cd19b6cd323dfb516317e3512a9af6 | |
parent | e0aebf5cf1c705739a94fe2fecf0b0ed7eb4ba3a (diff) | |
download | mariadb-git-91173f986373e4f5f134a2351a80d8763e5157e8.tar.gz |
fts_is_charset_cjk(): Avoid referencing global symbols
References to global symbols prevent InnoDB from being built as a
dynamic plugin on Windows.
Refer to CHARSET_INFO::number, because that is what InnoDB is already
persistently storing in its data dictionary.
-rw-r--r-- | storage/innobase/include/fts0types.ic | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/storage/innobase/include/fts0types.ic b/storage/innobase/include/fts0types.ic index 18bc87213fc..6c5542309bb 100644 --- a/storage/innobase/include/fts0types.ic +++ b/storage/innobase/include/fts0types.ic @@ -108,19 +108,21 @@ innobase_strnxfrm( @param[in] cs charset @retval true if the charset is cjk @retval false if not. */ -UNIV_INLINE -bool -fts_is_charset_cjk( - const CHARSET_INFO* cs) +inline bool fts_is_charset_cjk(const CHARSET_INFO* cs) { - 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; + switch (cs->number) { + case 24: /* my_charset_gb2312_chinese_ci */ + case 28: /* my_charset_gbk_chinese_ci */ + case 1: /* my_charset_big5_chinese_ci */ + case 12: /* my_charset_ujis_japanese_ci */ + case 13: /* my_charset_sjis_japanese_ci */ + case 95: /* my_charset_cp932_japanese_ci */ + case 97: /* my_charset_eucjpms_japanese_ci */ + case 19: /* my_charset_euckr_korean_ci */ + return true; + default: + return false; + } } /** Select the FTS auxiliary index for the given character by range. |