Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
345a0e5a
Commit
345a0e5a
authored
Mar 29, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error messages for not nullable
SET character_set_xxx=NULL and SET collation_xxx=NULL
parent
f8d9645d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
mysql-test/r/variables.result
mysql-test/r/variables.result
+4
-0
mysql-test/t/variables.test
mysql-test/t/variables.test
+4
-0
sql/set_var.cc
sql/set_var.cc
+5
-2
No files found.
mysql-test/r/variables.result
View file @
345a0e5a
...
...
@@ -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;
...
...
mysql-test/t/variables.test
View file @
345a0e5a
...
...
@@ -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
...
...
sql/set_var.cc
View file @
345a0e5a
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment