diff options
author | Sergei Golubchik <serg@mariadb.org> | 2014-09-20 21:36:51 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2014-10-01 23:38:26 +0200 |
commit | b04f848176b0d8af41eb3627ba1b6ed4dd3327e3 (patch) | |
tree | 91b4b7b0f9a692597214c0dcee407b740cbade2e /sql | |
parent | 1a731af1941f9df57c90dbad8614c76b65ba688d (diff) | |
download | mariadb-git-b04f848176b0d8af41eb3627ba1b6ed4dd3327e3.tar.gz |
cleanup: use is_supported_parser_charset
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_class.h | 4 | ||||
-rw-r--r-- | sql/sql_parse.h | 5 | ||||
-rw-r--r-- | sql/sys_vars.cc | 3 |
3 files changed, 5 insertions, 7 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 3424a3380f0..1154f0ac486 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -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 diff --git a/sql/sql_parse.h b/sql/sql_parse.h index 87f8854e050..3bbddc8ba4d 100644 --- a/sql/sql_parse.h +++ b/sql/sql_parse.h @@ -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 */ diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 959e65557c5..e40dfbe8675 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -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; |