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
e7d7910b
Commit
e7d7910b
authored
Dec 22, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add an assert
and use is_supported_parser_charset() instead of direct check
parent
48655ce6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
sql/sql_connect.cc
sql/sql_connect.cc
+7
-9
sql/sys_vars.cc
sql/sys_vars.cc
+2
-1
No files found.
sql/sql_connect.cc
View file @
e7d7910b
/*
Copyright (c) 2007, 2013, Oracle and/or its affiliates.
Copyright (c) 2008, 201
4, SkySQL Ab.
Copyright (c) 2008, 201
6, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -821,6 +821,7 @@ void update_global_user_stats(THD *thd, bool create_user, time_t now)
bool
thd_init_client_charset
(
THD
*
thd
,
uint
cs_number
)
{
SV
*
gv
=&
global_system_variables
;
CHARSET_INFO
*
cs
;
/*
Use server character set and collation if
...
...
@@ -831,16 +832,13 @@ bool thd_init_client_charset(THD *thd, uint cs_number)
*/
if
(
!
opt_character_set_client_handshake
||
!
(
cs
=
get_charset
(
cs_number
,
MYF
(
0
)))
||
!
my_strcasecmp
(
&
my_charset_latin1
,
global_system_variables
.
character_set_client
->
name
,
!
my_strcasecmp
(
&
my_charset_latin1
,
gv
->
character_set_client
->
name
,
cs
->
name
))
{
thd
->
variables
.
character_set_client
=
global_system_variables
.
character_set_client
;
thd
->
variables
.
collation_connection
=
global_system_variables
.
collation_connection
;
thd
->
variables
.
character_set_results
=
global_system_variables
.
character_set_results
;
DBUG_ASSERT
(
is_supported_parser_charset
(
gv
->
character_set_client
));
thd
->
variables
.
character_set_client
=
gv
->
character_set_client
;
thd
->
variables
.
collation_connection
=
gv
->
collation_connection
;
thd
->
variables
.
character_set_results
=
gv
->
character_set_results
;
}
else
{
...
...
sql/sys_vars.cc
View file @
e7d7910b
...
...
@@ -31,6 +31,7 @@
#include "my_global.h"
/* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "sql_class.h" // set_var.h: THD
#include "sql_parse.h"
#include "sys_vars.h"
#include "events.h"
...
...
@@ -445,7 +446,7 @@ static bool check_cs_client(sys_var *self, THD *thd, set_var *var)
return
true
;
// Currently, UCS-2 cannot be used as a client character set
if
(
((
CHARSET_INFO
*
)(
var
->
save_result
.
ptr
))
->
mbminlen
>
1
)
if
(
!
is_supported_parser_charset
((
CHARSET_INFO
*
)(
var
->
save_result
.
ptr
))
)
return
true
;
return
false
;
...
...
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