after-merge fix: new sys_var_character_set_client classs introduced to perform

separate checking.
parent a24102a0
......@@ -164,7 +164,8 @@ static sys_var_character_set_sv sys_character_set_server(&vars, "character_set_s
sys_var_const_str sys_charset_system(&vars, "character_set_system",
(char *)my_charset_utf8_general_ci.name);
static sys_var_character_set_database sys_character_set_database(&vars, "character_set_database");
static sys_var_character_set_sv sys_character_set_client(&vars, "character_set_client",
static sys_var_character_set_client sys_character_set_client(&vars,
"character_set_client",
&SV::character_set_client,
&default_charset_info);
static sys_var_character_set_sv sys_character_set_connection(&vars, "character_set_connection",
......@@ -1861,6 +1862,21 @@ CHARSET_INFO **sys_var_character_set_sv::ci_ptr(THD *thd, enum_var_type type)
}
bool sys_var_character_set_client::check(THD *thd, set_var *var)
{
if (sys_var_character_set_sv::check(thd, var))
return 1;
/* Currently, UCS-2 cannot be used as a client character set */
if (var->save_result.charset->mbminlen > 1)
{
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name,
var->save_result.charset->csname);
return 1;
}
return 0;
}
CHARSET_INFO ** sys_var_character_set_database::ci_ptr(THD *thd,
enum_var_type type)
{
......@@ -2290,6 +2306,13 @@ uchar *sys_var_log_output::value_ptr(THD *thd, enum_var_type type,
int set_var_collation_client::check(THD *thd)
{
/* Currently, UCS-2 cannot be used as a client character set */
if (character_set_client->mbminlen > 1)
{
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client",
character_set_client->csname);
return 1;
}
return 0;
}
......
......@@ -667,6 +667,20 @@ class sys_var_character_set_sv :public sys_var_character_set
};
class sys_var_character_set_client: public sys_var_character_set_sv
{
public:
sys_var_character_set_client(sys_var_chain *chain, const char *name_arg,
CHARSET_INFO *SV::*offset_arg,
CHARSET_INFO **global_default_arg,
bool is_nullable= 0)
: sys_var_character_set_sv(chain, name_arg, offset_arg, global_default_arg,
is_nullable)
{ }
bool check(THD *thd, set_var *var);
};
class sys_var_character_set_database :public sys_var_character_set
{
public:
......
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