Commit b04f8481 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: use is_supported_parser_charset

parent 1a731af1
...@@ -801,6 +801,10 @@ mysqld_collation_get_by_name(const char *name, ...@@ -801,6 +801,10 @@ mysqld_collation_get_by_name(const char *name,
return cs; return cs;
} }
inline bool is_supported_parser_charset(CHARSET_INFO *cs)
{
return MY_TEST(cs->mbminlen == 1);
}
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
......
...@@ -198,9 +198,4 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables, ...@@ -198,9 +198,4 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
bool check_global_access(THD *thd, ulong want_access, bool no_errors= false); bool check_global_access(THD *thd, ulong want_access, bool no_errors= false);
inline bool is_supported_parser_charset(CHARSET_INFO *cs)
{
return MY_TEST(cs->mbminlen == 1);
}
#endif /* SQL_PARSE_INCLUDED */ #endif /* SQL_PARSE_INCLUDED */
...@@ -622,8 +622,7 @@ static bool check_cs_client(sys_var *self, THD *thd, set_var *var) ...@@ -622,8 +622,7 @@ static bool check_cs_client(sys_var *self, THD *thd, set_var *var)
if (check_charset_not_null(self, thd, var)) if (check_charset_not_null(self, thd, var))
return true; return true;
// Currently, UCS-2 cannot be used as a client character set if (!is_supported_parser_charset((CHARSET_INFO *)(var->save_result.ptr)))
if (((CHARSET_INFO *)(var->save_result.ptr))->mbminlen > 1)
return true; return true;
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment