Skip to content

Commit

Permalink
cleanup: use is_supported_parser_charset
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Oct 1, 2014
1 parent 1a731af commit b04f848
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 4 additions & 0 deletions sql/sql_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,10 @@ mysqld_collation_get_by_name(const char *name,
return cs;
}

inline bool is_supported_parser_charset(CHARSET_INFO *cs)
{
return MY_TEST(cs->mbminlen == 1);
}

#ifdef MYSQL_SERVER

Expand Down
5 changes: 0 additions & 5 deletions sql/sql_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

inline bool is_supported_parser_charset(CHARSET_INFO *cs)
{
return MY_TEST(cs->mbminlen == 1);
}

#endif /* SQL_PARSE_INCLUDED */
3 changes: 1 addition & 2 deletions sql/sys_vars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
return true;

// Currently, UCS-2 cannot be used as a client character set
if (((CHARSET_INFO *)(var->save_result.ptr))->mbminlen > 1)
if (!is_supported_parser_charset((CHARSET_INFO *)(var->save_result.ptr)))
return true;

return false;
Expand Down

0 comments on commit b04f848

Please sign in to comment.