Commit adb8c7e0 authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

SET character_set_results=NULL is now working

parent 0cb3f348
......@@ -1280,9 +1280,15 @@ bool sys_var_character_set::check(THD *thd, set_var *var)
String str(buff,sizeof(buff), system_charset_info), *res;
if (!(res=var->value->val_str(&str)))
res= &empty_string;
if (!(tmp=get_charset_by_csname(res->c_ptr(),MY_CS_PRIMARY,MYF(0))) &&
{
if (!nullable)
{
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "NULL");
return 1;
}
tmp= NULL;
}
else if (!(tmp=get_charset_by_csname(res->c_ptr(),MY_CS_PRIMARY,MYF(0))) &&
!(tmp=get_old_charset_by_name(res->c_ptr())))
{
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), res->c_ptr());
......
......@@ -433,7 +433,9 @@ SHOW_TYPE type() { return SHOW_CHAR; }
class sys_var_character_set :public sys_var_thd
{
public:
sys_var_character_set(const char *name_arg) :sys_var_thd(name_arg) {}
bool nullable;
sys_var_character_set(const char *name_arg) :sys_var_thd(name_arg)
{ nullable= 0; }
bool check(THD *thd, set_var *var);
SHOW_TYPE type() { return SHOW_CHAR; }
bool check_update_type(Item_result type)
......@@ -460,7 +462,8 @@ class sys_var_character_set_results :public sys_var_character_set
{
public:
sys_var_character_set_results(const char *name_arg) :
sys_var_character_set(name_arg) {}
sys_var_character_set(name_arg)
{ nullable= 1; }
void set_default(THD *thd, enum_var_type type);
CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
};
......
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