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
7ce517c9
Commit
7ce517c9
authored
Feb 14, 2020
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perfschema status vars instrumentation related changes
parent
d4605bc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
sql/sql_show.cc
sql/sql_show.cc
+11
-1
sql/sql_show.h
sql/sql_show.h
+1
-0
No files found.
sql/sql_show.cc
View file @
7ce517c9
...
@@ -3307,8 +3307,9 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
...
@@ -3307,8 +3307,9 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
Status functions
Status functions
*****************************************************************************/
*****************************************************************************/
static
DYNAMIC_ARRAY
all_status_vars
;
DYNAMIC_ARRAY
all_status_vars
;
static
bool
status_vars_inited
=
0
;
static
bool
status_vars_inited
=
0
;
ulonglong
status_var_array_version
=
0
;
C_MODE_START
C_MODE_START
static
int
show_var_cmp
(
const
void
*
var1
,
const
void
*
var2
)
static
int
show_var_cmp
(
const
void
*
var1
,
const
void
*
var2
)
...
@@ -3336,6 +3337,7 @@ static void shrink_var_array(DYNAMIC_ARRAY *array)
...
@@ -3336,6 +3337,7 @@ static void shrink_var_array(DYNAMIC_ARRAY *array)
}
}
else
// array is completely empty - delete it
else
// array is completely empty - delete it
delete_dynamic
(
array
);
delete_dynamic
(
array
);
status_var_array_version
++
;
}
}
/*
/*
...
@@ -3375,6 +3377,7 @@ int add_status_vars(SHOW_VAR *list)
...
@@ -3375,6 +3377,7 @@ int add_status_vars(SHOW_VAR *list)
all_status_vars
.
elements
--
;
// but next insert_dynamic should overwite it
all_status_vars
.
elements
--
;
// but next insert_dynamic should overwite it
if
(
status_vars_inited
)
if
(
status_vars_inited
)
sort_dynamic
(
&
all_status_vars
,
show_var_cmp
);
sort_dynamic
(
&
all_status_vars
,
show_var_cmp
);
status_var_array_version
++
;
err:
err:
if
(
status_vars_inited
)
if
(
status_vars_inited
)
mysql_rwlock_unlock
(
&
LOCK_all_status_vars
);
mysql_rwlock_unlock
(
&
LOCK_all_status_vars
);
...
@@ -3393,6 +3396,7 @@ void init_status_vars()
...
@@ -3393,6 +3396,7 @@ void init_status_vars()
{
{
status_vars_inited
=
1
;
status_vars_inited
=
1
;
sort_dynamic
(
&
all_status_vars
,
show_var_cmp
);
sort_dynamic
(
&
all_status_vars
,
show_var_cmp
);
status_var_array_version
++
;
}
}
void
reset_status_vars
()
void
reset_status_vars
()
...
@@ -3419,6 +3423,7 @@ void reset_status_vars()
...
@@ -3419,6 +3423,7 @@ void reset_status_vars()
void
free_status_vars
()
void
free_status_vars
()
{
{
delete_dynamic
(
&
all_status_vars
);
delete_dynamic
(
&
all_status_vars
);
status_var_array_version
++
;
}
}
/*
/*
...
@@ -3480,6 +3485,11 @@ void remove_status_vars(SHOW_VAR *list)
...
@@ -3480,6 +3485,11 @@ void remove_status_vars(SHOW_VAR *list)
}
}
}
}
/* Current version of the all_status_vars. */
ulonglong
get_status_vars_version
(
void
)
{
return
status_var_array_version
;
}
/**
/**
@brief Returns the value of a system or a status variable.
@brief Returns the value of a system or a status variable.
...
...
sql/sql_show.h
View file @
7ce517c9
...
@@ -119,6 +119,7 @@ bool append_definer(THD *thd, String *buffer, const LEX_CSTRING *definer_user,
...
@@ -119,6 +119,7 @@ bool append_definer(THD *thd, String *buffer, const LEX_CSTRING *definer_user,
const
LEX_CSTRING
*
definer_host
);
const
LEX_CSTRING
*
definer_host
);
int
add_status_vars
(
SHOW_VAR
*
list
);
int
add_status_vars
(
SHOW_VAR
*
list
);
void
remove_status_vars
(
SHOW_VAR
*
list
);
void
remove_status_vars
(
SHOW_VAR
*
list
);
ulonglong
get_status_vars_version
(
void
);
void
init_status_vars
();
void
init_status_vars
();
void
free_status_vars
();
void
free_status_vars
();
void
reset_status_vars
();
void
reset_status_vars
();
...
...
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