diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-02-14 16:53:53 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-03-10 19:24:23 +0100 |
commit | cea187e349f8a129ef8ae0a8b49bb0a138de8978 (patch) | |
tree | c35f565c2fb945ce40c993b036f251a3c5bef5f7 /sql/set_var.cc | |
parent | 7ce517c95132037e8e6e2512d4191ed4e254a54e (diff) | |
download | mariadb-git-cea187e349f8a129ef8ae0a8b49bb0a138de8978.tar.gz |
perfschema sysvar instrumentation related changes
incomplete. locking issues
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index eadbfd4ba7d..c195312a096 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -43,6 +43,7 @@ static HASH system_variable_hash; static PolyLock_mutex PLock_global_system_variables(&LOCK_global_system_variables); +static ulonglong system_variable_hash_version= 0; /** Return variable name and length for hashing of variables. @@ -584,6 +585,8 @@ int mysql_add_sys_var_chain(sys_var *first) goto error; } } + /* Update system_variable_hash version. */ + system_variable_hash_version++; return 0; error: @@ -614,6 +617,8 @@ int mysql_del_sys_var_chain(sys_var *first) result|= my_hash_delete(&system_variable_hash, (uchar*) var); mysql_prlock_unlock(&LOCK_system_variables_hash); + /* Update system_variable_hash version. */ + system_variable_hash_version++; return result; } @@ -624,6 +629,16 @@ static int show_cmp(SHOW_VAR *a, SHOW_VAR *b) } +/* + Number of records in the system_variable_hash. + Requires lock on LOCK_system_variables_hash. +*/ +ulong get_system_variable_hash_records(void) +{ + return system_variable_hash.records; +} + + /** Constructs an array of system variables for display to the user. @@ -1504,3 +1519,13 @@ pretty_print_engine_list(THD *thd, plugin_ref *list) *pos= '\0'; return buf; } + +/* + Current version of the system_variable_hash. + Requires lock on LOCK_system_variables_hash. +*/ +ulonglong get_system_variable_hash_version(void) +{ + return system_variable_hash_version; +} + |