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
5389300f
Commit
5389300f
authored
Aug 29, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: option_type -> scope
parent
99677cc5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
20 deletions
+18
-20
sql/set_var.cc
sql/set_var.cc
+3
-3
sql/sql_plugin.h
sql/sql_plugin.h
+0
-1
sql/sql_show.cc
sql/sql_show.cc
+15
-16
No files found.
sql/set_var.cc
View file @
5389300f
...
...
@@ -565,7 +565,7 @@ static int show_cmp(SHOW_VAR *a, SHOW_VAR *b)
@param thd current thread
@param sorted If TRUE, the system variables should be sorted
@param
type
OPT_GLOBAL or OPT_SESSION for SHOW GLOBAL|SESSION VARIABLES
@param
scope
OPT_GLOBAL or OPT_SESSION for SHOW GLOBAL|SESSION VARIABLES
@retval
pointer Array of SHOW_VAR elements for display
...
...
@@ -573,7 +573,7 @@ static int show_cmp(SHOW_VAR *a, SHOW_VAR *b)
NULL FAILURE
*/
SHOW_VAR
*
enumerate_sys_vars
(
THD
*
thd
,
bool
sorted
,
enum
enum_var_type
ty
pe
)
SHOW_VAR
*
enumerate_sys_vars
(
THD
*
thd
,
bool
sorted
,
enum
enum_var_type
sco
pe
)
{
int
count
=
system_variable_hash
.
records
,
i
;
int
size
=
sizeof
(
SHOW_VAR
)
*
(
count
+
1
);
...
...
@@ -588,7 +588,7 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type)
sys_var
*
var
=
(
sys_var
*
)
my_hash_element
(
&
system_variable_hash
,
i
);
// don't show session-only variables in SHOW GLOBAL VARIABLES
if
(
type
==
OPT_GLOBAL
&&
var
->
check_type
(
ty
pe
))
if
(
scope
==
OPT_GLOBAL
&&
var
->
check_type
(
sco
pe
))
continue
;
show
->
name
=
var
->
name
.
str
;
...
...
sql/sql_plugin.h
View file @
5389300f
...
...
@@ -17,7 +17,6 @@
#ifndef _sql_plugin_h
#define _sql_plugin_h
/*
the following #define adds server-only members to enum_mysql_show_type,
that is defined in plugin.h
...
...
sql/sql_show.cc
View file @
5389300f
...
...
@@ -2902,7 +2902,7 @@ void remove_status_vars(SHOW_VAR *list)
static
bool
show_status_array
(
THD
*
thd
,
const
char
*
wild
,
SHOW_VAR
*
variables
,
enum
enum_var_type
value_ty
pe
,
enum
enum_var_type
sco
pe
,
struct
system_status_var
*
status_var
,
const
char
*
prefix
,
TABLE
*
table
,
bool
ucase_names
,
...
...
@@ -2911,8 +2911,7 @@ static bool show_status_array(THD *thd, const char *wild,
my_aligned_storage
<
SHOW_VAR_FUNC_BUFF_SIZE
,
MY_ALIGNOF
(
long
)
>
buffer
;
char
*
const
buff
=
buffer
.
data
;
char
*
prefix_end
;
/* the variable name should not be longer than 64 characters */
char
name_buffer
[
64
];
char
name_buffer
[
NAME_CHAR_LEN
];
int
len
;
SHOW_VAR
tmp
,
*
var
;
enum_check_fields
save_count_cuted_fields
=
thd
->
count_cuted_fields
;
...
...
@@ -3002,7 +3001,7 @@ static bool show_status_array(THD *thd, const char *wild,
SHOW_TYPE
show_type
=
var
->
type
;
if
(
show_type
==
SHOW_ARRAY
)
{
show_status_array
(
thd
,
wild
,
(
SHOW_VAR
*
)
var
->
value
,
value_ty
pe
,
show_status_array
(
thd
,
wild
,
(
SHOW_VAR
*
)
var
->
value
,
sco
pe
,
status_var
,
name_buffer
,
table
,
ucase_names
,
cond
);
}
else
...
...
@@ -3021,7 +3020,7 @@ static bool show_status_array(THD *thd, const char *wild,
{
sys_var
*
var
=
((
sys_var
*
)
value
);
show_type
=
var
->
show_type
();
value
=
(
char
*
)
var
->
value_ptr
(
thd
,
value_ty
pe
,
&
null_lex_str
);
value
=
(
char
*
)
var
->
value_ptr
(
thd
,
sco
pe
,
&
null_lex_str
);
charset
=
var
->
charset
(
thd
);
}
...
...
@@ -7225,19 +7224,19 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond)
const
char
*
wild
=
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
;
enum
enum_schema_tables
schema_table_idx
=
get_schema_table_idx
(
tables
->
schema_table
);
enum
enum_var_type
option_ty
pe
=
OPT_SESSION
;
enum
enum_var_type
sco
pe
=
OPT_SESSION
;
bool
upper_case_names
=
lex
->
sql_command
!=
SQLCOM_SHOW_VARIABLES
;
bool
sorted_vars
=
lex
->
sql_command
==
SQLCOM_SHOW_VARIABLES
;
if
(
lex
->
option_type
==
OPT_GLOBAL
||
schema_table_idx
==
SCH_GLOBAL_VARIABLES
)
option_ty
pe
=
OPT_GLOBAL
;
sco
pe
=
OPT_GLOBAL
;
COND
*
partial_cond
=
make_cond_for_info_schema
(
cond
,
tables
);
mysql_rwlock_rdlock
(
&
LOCK_system_variables_hash
);
res
=
show_status_array
(
thd
,
wild
,
enumerate_sys_vars
(
thd
,
sorted_vars
,
option_ty
pe
),
option_ty
pe
,
NULL
,
""
,
tables
->
table
,
res
=
show_status_array
(
thd
,
wild
,
enumerate_sys_vars
(
thd
,
sorted_vars
,
sco
pe
),
sco
pe
,
NULL
,
""
,
tables
->
table
,
upper_case_names
,
partial_cond
);
mysql_rwlock_unlock
(
&
LOCK_system_variables_hash
);
DBUG_RETURN
(
res
);
...
...
@@ -7253,25 +7252,25 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
STATUS_VAR
*
tmp1
,
tmp
;
enum
enum_schema_tables
schema_table_idx
=
get_schema_table_idx
(
tables
->
schema_table
);
enum
enum_var_type
option_ty
pe
;
enum
enum_var_type
sco
pe
;
bool
upper_case_names
=
lex
->
sql_command
!=
SQLCOM_SHOW_STATUS
;
if
(
lex
->
sql_command
==
SQLCOM_SHOW_STATUS
)
{
option_ty
pe
=
lex
->
option_type
;
if
(
option_ty
pe
==
OPT_GLOBAL
)
sco
pe
=
lex
->
option_type
;
if
(
sco
pe
==
OPT_GLOBAL
)
tmp1
=
&
tmp
;
else
tmp1
=
thd
->
initial_status_var
;
}
else
if
(
schema_table_idx
==
SCH_GLOBAL_STATUS
)
{
option_ty
pe
=
OPT_GLOBAL
;
sco
pe
=
OPT_GLOBAL
;
tmp1
=
&
tmp
;
}
else
{
option_ty
pe
=
OPT_SESSION
;
sco
pe
=
OPT_SESSION
;
tmp1
=
&
thd
->
status_var
;
}
...
...
@@ -7281,11 +7280,11 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
partial_cond
->
val_int
();
mysql_mutex_lock
(
&
LOCK_status
);
if
(
option_ty
pe
==
OPT_GLOBAL
)
if
(
sco
pe
==
OPT_GLOBAL
)
calc_sum_of_all_status
(
&
tmp
);
res
=
show_status_array
(
thd
,
wild
,
(
SHOW_VAR
*
)
all_status_vars
.
buffer
,
option_ty
pe
,
tmp1
,
""
,
tables
->
table
,
sco
pe
,
tmp1
,
""
,
tables
->
table
,
upper_case_names
,
partial_cond
);
mysql_mutex_unlock
(
&
LOCK_status
);
DBUG_RETURN
(
res
);
...
...
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