summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorunknown <bar@bar.intranet.mysql.r18.ru>2004-03-29 18:33:24 +0500
committerunknown <bar@bar.intranet.mysql.r18.ru>2004-03-29 18:33:24 +0500
commit399845aeddfdc6f6cc9762fe55afee20444706af (patch)
tree7fc48402cfca442977ac848a9b63af8563851f2d /sql/set_var.cc
parent5babbd233b88d547b9642ac029c7b24113e709c1 (diff)
downloadmariadb-git-399845aeddfdc6f6cc9762fe55afee20444706af.tar.gz
Better error messages for not nullable
SET character_set_xxx=NULL and SET collation_xxx=NULL
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index d59a01f01cb..5d2a6c1d39e 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1678,7 +1678,10 @@ bool sys_var_collation::check(THD *thd, set_var *var)
String str(buff,sizeof(buff), system_charset_info), *res;
if (!(res=var->value->val_str(&str)))
- res= &my_empty_string;
+ {
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL");
+ return 1;
+ }
if (!(tmp=get_charset_by_name(res->c_ptr(),MYF(0))))
{
@@ -1700,7 +1703,7 @@ bool sys_var_character_set::check(THD *thd, set_var *var)
{
if (!nullable)
{
- my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "NULL");
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL");
return 1;
}
tmp= NULL;