Skip to content

Commit 91173f9

Browse files
committed
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.
1 parent e0aebf5 commit 91173f9

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

storage/innobase/include/fts0types.ic

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,21 @@ innobase_strnxfrm(
108108
@param[in] cs charset
109109
@retval true if the charset is cjk
110110
@retval false if not. */
111-
UNIV_INLINE
112-
bool
113-
fts_is_charset_cjk(
114-
const CHARSET_INFO* cs)
111+
inline bool fts_is_charset_cjk(const CHARSET_INFO* cs)
115112
{
116-
return cs == &my_charset_gb2312_chinese_ci
117-
|| cs == &my_charset_gbk_chinese_ci
118-
|| cs == &my_charset_big5_chinese_ci
119-
|| cs == &my_charset_ujis_japanese_ci
120-
|| cs == &my_charset_sjis_japanese_ci
121-
|| cs == &my_charset_cp932_japanese_ci
122-
|| cs == &my_charset_eucjpms_japanese_ci
123-
|| cs == &my_charset_euckr_korean_ci;
113+
switch (cs->number) {
114+
case 24: /* my_charset_gb2312_chinese_ci */
115+
case 28: /* my_charset_gbk_chinese_ci */
116+
case 1: /* my_charset_big5_chinese_ci */
117+
case 12: /* my_charset_ujis_japanese_ci */
118+
case 13: /* my_charset_sjis_japanese_ci */
119+
case 95: /* my_charset_cp932_japanese_ci */
120+
case 97: /* my_charset_eucjpms_japanese_ci */
121+
case 19: /* my_charset_euckr_korean_ci */
122+
return true;
123+
default:
124+
return false;
125+
}
124126
}
125127

126128
/** Select the FTS auxiliary index for the given character by range.

0 commit comments

Comments
 (0)