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
31e52b16
Commit
31e52b16
authored
Mar 12, 2018
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize charset tracking a bit.
parent
517d7182
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
19 deletions
+15
-19
sql/set_var.cc
sql/set_var.cc
+6
-18
sql/set_var.h
sql/set_var.h
+3
-1
sql/sys_vars.cc
sql/sys_vars.cc
+6
-0
No files found.
sql/set_var.cc
View file @
31e52b16
...
@@ -1016,24 +1016,12 @@ int set_var_collation_client::update(THD *thd)
...
@@ -1016,24 +1016,12 @@ int set_var_collation_client::update(THD *thd)
#ifndef EMBEDDED_LIBRARY
#ifndef EMBEDDED_LIBRARY
if
(
thd
->
session_tracker
.
get_tracker
(
SESSION_SYSVARS_TRACKER
)
->
is_enabled
())
if
(
thd
->
session_tracker
.
get_tracker
(
SESSION_SYSVARS_TRACKER
)
->
is_enabled
())
{
{
sys_var
*
svar
;
thd
->
session_tracker
.
get_tracker
(
SESSION_SYSVARS_TRACKER
)
->
mysql_mutex_lock
(
&
LOCK_plugin
);
mark_as_changed
(
thd
,
(
LEX_CSTRING
*
)
Sys_character_set_client_ptr
);
if
((
svar
=
find_sys_var_ex
(
thd
,
"character_set_client"
,
thd
->
session_tracker
.
get_tracker
(
SESSION_SYSVARS_TRACKER
)
->
sizeof
(
"character_set_client"
)
-
1
,
mark_as_changed
(
thd
,
(
LEX_CSTRING
*
)
Sys_character_set_results_ptr
);
false
,
true
)))
thd
->
session_tracker
.
get_tracker
(
SESSION_SYSVARS_TRACKER
)
->
thd
->
session_tracker
.
get_tracker
(
SESSION_SYSVARS_TRACKER
)
->
mark_as_changed
(
thd
,
(
LEX_CSTRING
*
)
Sys_character_set_connection_ptr
);
mark_as_changed
(
thd
,
(
LEX_CSTRING
*
)
svar
);
if
((
svar
=
find_sys_var_ex
(
thd
,
"character_set_results"
,
sizeof
(
"character_set_results"
)
-
1
,
false
,
true
)))
thd
->
session_tracker
.
get_tracker
(
SESSION_SYSVARS_TRACKER
)
->
mark_as_changed
(
thd
,
(
LEX_CSTRING
*
)
svar
);
if
((
svar
=
find_sys_var_ex
(
thd
,
"character_set_connection"
,
sizeof
(
"character_set_connection"
)
-
1
,
false
,
true
)))
thd
->
session_tracker
.
get_tracker
(
SESSION_SYSVARS_TRACKER
)
->
mark_as_changed
(
thd
,
(
LEX_CSTRING
*
)
svar
);
mysql_mutex_unlock
(
&
LOCK_plugin
);
}
}
thd
->
session_tracker
.
mark_as_changed
(
thd
,
SESSION_STATE_CHANGE_TRACKER
,
NULL
);
thd
->
session_tracker
.
mark_as_changed
(
thd
,
SESSION_STATE_CHANGE_TRACKER
,
NULL
);
#endif //EMBEDDED_LIBRARY
#endif //EMBEDDED_LIBRARY
...
...
sql/set_var.h
View file @
31e52b16
...
@@ -430,7 +430,9 @@ sql_mode_t expand_sql_mode(sql_mode_t sql_mode);
...
@@ -430,7 +430,9 @@ sql_mode_t expand_sql_mode(sql_mode_t sql_mode);
bool
sql_mode_string_representation
(
THD
*
thd
,
sql_mode_t
sql_mode
,
LEX_STRING
*
ls
);
bool
sql_mode_string_representation
(
THD
*
thd
,
sql_mode_t
sql_mode
,
LEX_STRING
*
ls
);
int
default_regex_flags_pcre
(
const
THD
*
thd
);
int
default_regex_flags_pcre
(
const
THD
*
thd
);
extern
sys_var
*
Sys_autocommit_ptr
,
*
Sys_last_gtid_ptr
;
extern
sys_var
*
Sys_autocommit_ptr
,
*
Sys_last_gtid_ptr
,
*
Sys_character_set_client_ptr
,
*
Sys_character_set_connection_ptr
,
*
Sys_character_set_results_ptr
;
CHARSET_INFO
*
get_old_charset_by_name
(
const
char
*
old_name
);
CHARSET_INFO
*
get_old_charset_by_name
(
const
char
*
old_name
);
...
...
sql/sys_vars.cc
View file @
31e52b16
...
@@ -673,6 +673,8 @@ static Sys_var_struct Sys_character_set_client(
...
@@ -673,6 +673,8 @@ static Sys_var_struct Sys_character_set_client(
offsetof
(
CHARSET_INFO
,
csname
),
DEFAULT
(
&
default_charset_info
),
offsetof
(
CHARSET_INFO
,
csname
),
DEFAULT
(
&
default_charset_info
),
NO_MUTEX_GUARD
,
IN_BINLOG
,
ON_CHECK
(
check_cs_client
),
NO_MUTEX_GUARD
,
IN_BINLOG
,
ON_CHECK
(
check_cs_client
),
ON_UPDATE
(
fix_thd_charset
));
ON_UPDATE
(
fix_thd_charset
));
// for check changing
export
sys_var
*
Sys_character_set_client_ptr
=
&
Sys_character_set_client
;
static
Sys_var_struct
Sys_character_set_connection
(
static
Sys_var_struct
Sys_character_set_connection
(
"character_set_connection"
,
"The character set used for "
"character_set_connection"
,
"The character set used for "
...
@@ -682,6 +684,8 @@ static Sys_var_struct Sys_character_set_connection(
...
@@ -682,6 +684,8 @@ static Sys_var_struct Sys_character_set_connection(
offsetof
(
CHARSET_INFO
,
csname
),
DEFAULT
(
&
default_charset_info
),
offsetof
(
CHARSET_INFO
,
csname
),
DEFAULT
(
&
default_charset_info
),
NO_MUTEX_GUARD
,
IN_BINLOG
,
ON_CHECK
(
check_charset_not_null
),
NO_MUTEX_GUARD
,
IN_BINLOG
,
ON_CHECK
(
check_charset_not_null
),
ON_UPDATE
(
fix_thd_charset
));
ON_UPDATE
(
fix_thd_charset
));
// for check changing
export
sys_var
*
Sys_character_set_connection_ptr
=
&
Sys_character_set_connection
;
static
Sys_var_struct
Sys_character_set_results
(
static
Sys_var_struct
Sys_character_set_results
(
"character_set_results"
,
"The character set used for returning "
"character_set_results"
,
"The character set used for returning "
...
@@ -689,6 +693,8 @@ static Sys_var_struct Sys_character_set_results(
...
@@ -689,6 +693,8 @@ static Sys_var_struct Sys_character_set_results(
SESSION_VAR
(
character_set_results
),
NO_CMD_LINE
,
SESSION_VAR
(
character_set_results
),
NO_CMD_LINE
,
offsetof
(
CHARSET_INFO
,
csname
),
DEFAULT
(
&
default_charset_info
),
offsetof
(
CHARSET_INFO
,
csname
),
DEFAULT
(
&
default_charset_info
),
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
check_charset
));
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
check_charset
));
// for check changing
export
sys_var
*
Sys_character_set_results_ptr
=
&
Sys_character_set_results
;
static
Sys_var_struct
Sys_character_set_filesystem
(
static
Sys_var_struct
Sys_character_set_filesystem
(
"character_set_filesystem"
,
"The filesystem character set"
,
"character_set_filesystem"
,
"The filesystem character set"
,
...
...
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