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
70b94c35
Commit
70b94c35
authored
Jun 14, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: move common test into a function
parent
b850fc66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
sql/sql_plugin.cc
sql/sql_plugin.cc
+10
-8
No files found.
sql/sql_plugin.cc
View file @
70b94c35
...
@@ -316,6 +316,12 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin);
...
@@ -316,6 +316,12 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin);
static
void
intern_plugin_unlock
(
LEX
*
lex
,
plugin_ref
plugin
);
static
void
intern_plugin_unlock
(
LEX
*
lex
,
plugin_ref
plugin
);
static
void
reap_plugins
(
void
);
static
void
reap_plugins
(
void
);
bool
plugin_is_forced
(
struct
st_plugin_int
*
p
)
{
return
p
->
load_option
==
PLUGIN_FORCE
||
p
->
load_option
==
PLUGIN_FORCE_PLUS_PERMANENT
;
}
static
void
report_error
(
int
where_to
,
uint
error
,
...)
static
void
report_error
(
int
where_to
,
uint
error
,
...)
{
{
va_list
args
;
va_list
args
;
...
@@ -1657,8 +1663,7 @@ int plugin_init(int *argc, char **argv, int flags)
...
@@ -1657,8 +1663,7 @@ int plugin_init(int *argc, char **argv, int flags)
while
((
plugin_ptr
=
*
(
--
reap
)))
while
((
plugin_ptr
=
*
(
--
reap
)))
{
{
mysql_mutex_unlock
(
&
LOCK_plugin
);
mysql_mutex_unlock
(
&
LOCK_plugin
);
if
(
plugin_ptr
->
load_option
==
PLUGIN_FORCE
||
if
(
plugin_is_forced
(
plugin_ptr
))
plugin_ptr
->
load_option
==
PLUGIN_FORCE_PLUS_PERMANENT
)
reaped_mandatory_plugin
=
TRUE
;
reaped_mandatory_plugin
=
TRUE
;
plugin_deinitialize
(
plugin_ptr
,
true
);
plugin_deinitialize
(
plugin_ptr
,
true
);
mysql_mutex_lock
(
&
LOCK_plugin
);
mysql_mutex_lock
(
&
LOCK_plugin
);
...
@@ -3505,8 +3510,7 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
...
@@ -3505,8 +3510,7 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
plugin_dash
.
length
+
1
);
plugin_dash
.
length
+
1
);
strxmov
(
plugin_name_with_prefix_ptr
,
plugin_dash
.
str
,
plugin_name_ptr
,
NullS
);
strxmov
(
plugin_name_with_prefix_ptr
,
plugin_dash
.
str
,
plugin_name_ptr
,
NullS
);
if
(
tmp
->
load_option
!=
PLUGIN_FORCE
&&
if
(
!
plugin_is_forced
(
tmp
))
tmp
->
load_option
!=
PLUGIN_FORCE_PLUS_PERMANENT
)
{
{
/* support --skip-plugin-foo syntax */
/* support --skip-plugin-foo syntax */
options
[
0
].
name
=
plugin_name_ptr
;
options
[
0
].
name
=
plugin_name_ptr
;
...
@@ -3823,8 +3827,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
...
@@ -3823,8 +3827,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
We adjust the default value to account for the hardcoded exceptions
We adjust the default value to account for the hardcoded exceptions
we have set for the federated and ndbcluster storage engines.
we have set for the federated and ndbcluster storage engines.
*/
*/
if
(
tmp
->
load_option
!=
PLUGIN_FORCE
&&
if
(
!
plugin_is_forced
(
tmp
))
tmp
->
load_option
!=
PLUGIN_FORCE_PLUS_PERMANENT
)
opts
[
0
].
def_value
=
opts
[
1
].
def_value
=
plugin_load_option
;
opts
[
0
].
def_value
=
opts
[
1
].
def_value
=
plugin_load_option
;
error
=
handle_options
(
argc
,
&
argv
,
opts
,
NULL
);
error
=
handle_options
(
argc
,
&
argv
,
opts
,
NULL
);
...
@@ -3840,8 +3843,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
...
@@ -3840,8 +3843,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
Set plugin loading policy from option value. First element in the option
Set plugin loading policy from option value. First element in the option
list is always the <plugin name> option value.
list is always the <plugin name> option value.
*/
*/
if
(
tmp
->
load_option
!=
PLUGIN_FORCE
&&
if
(
!
plugin_is_forced
(
tmp
))
tmp
->
load_option
!=
PLUGIN_FORCE_PLUS_PERMANENT
)
plugin_load_option
=
(
enum_plugin_load_option
)
*
(
ulong
*
)
opts
[
0
].
value
;
plugin_load_option
=
(
enum_plugin_load_option
)
*
(
ulong
*
)
opts
[
0
].
value
;
}
}
...
...
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