mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Better error messages for not nullable
SET character_set_xxx=NULL and SET collation_xxx=NULL
This commit is contained in:
parent
11f14e0050
commit
928e796e67
3 changed files with 13 additions and 2 deletions
|
@ -233,6 +233,10 @@ set character_set_client=UNKNOWN_CHARACTER_SET;
|
|||
ERROR 42000: Unknown character set: 'UNKNOWN_CHARACTER_SET'
|
||||
set collation_connection=UNKNOWN_COLLATION;
|
||||
ERROR HY000: Unknown collation: 'UNKNOWN_COLLATION'
|
||||
set character_set_client=NULL;
|
||||
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'NULL'
|
||||
set collation_connection=NULL;
|
||||
ERROR 42000: Variable 'collation_connection' can't be set to the value of 'NULL'
|
||||
set global autocommit=1;
|
||||
ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL
|
||||
select @@global.timestamp;
|
||||
|
|
|
@ -137,6 +137,10 @@ set GLOBAL storage_engine=DEFAULT;
|
|||
set character_set_client=UNKNOWN_CHARACTER_SET;
|
||||
--error 1273
|
||||
set collation_connection=UNKNOWN_COLLATION;
|
||||
--error 1231
|
||||
set character_set_client=NULL;
|
||||
--error 1231
|
||||
set collation_connection=NULL;
|
||||
--error 1228
|
||||
set global autocommit=1;
|
||||
--error 1238
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue