diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-02-14 17:02:08 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-03-10 19:24:23 +0100 |
commit | 7ce517c95132037e8e6e2512d4191ed4e254a54e (patch) | |
tree | 049053d1a56995ddb91f313b9bc91e607e14eb74 /sql/sql_show.cc | |
parent | d4605bc90fa488ef27393ce7e45e88b4b9bf2c46 (diff) | |
download | mariadb-git-7ce517c95132037e8e6e2512d4191ed4e254a54e.tar.gz |
perfschema status vars instrumentation related changes
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index b7b0bdc8dd7..0efa91293b2 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3307,8 +3307,9 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) Status functions *****************************************************************************/ -static DYNAMIC_ARRAY all_status_vars; +DYNAMIC_ARRAY all_status_vars; static bool status_vars_inited= 0; +ulonglong status_var_array_version= 0; C_MODE_START static int show_var_cmp(const void *var1, const void *var2) @@ -3336,6 +3337,7 @@ static void shrink_var_array(DYNAMIC_ARRAY *array) } else // array is completely empty - delete it delete_dynamic(array); + status_var_array_version++; } /* @@ -3375,6 +3377,7 @@ int add_status_vars(SHOW_VAR *list) all_status_vars.elements--; // but next insert_dynamic should overwite it if (status_vars_inited) sort_dynamic(&all_status_vars, show_var_cmp); + status_var_array_version++; err: if (status_vars_inited) mysql_rwlock_unlock(&LOCK_all_status_vars); @@ -3393,6 +3396,7 @@ void init_status_vars() { status_vars_inited=1; sort_dynamic(&all_status_vars, show_var_cmp); + status_var_array_version++; } void reset_status_vars() @@ -3419,6 +3423,7 @@ void reset_status_vars() void free_status_vars() { delete_dynamic(&all_status_vars); + status_var_array_version++; } /* @@ -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. |