diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2016-06-27 15:01:22 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2016-07-08 23:38:05 +0400 |
commit | ecb27d2650da546c53bf7ff709cc6bf5bfa7f289 (patch) | |
tree | 64b9e34560c78468837c43c7c2333c1cc556e40b /sql/sql_show.cc | |
parent | 95c286cedf4b9330240a0a91a9fc3e58a17782b9 (diff) | |
download | mariadb-git-ecb27d2650da546c53bf7ff709cc6bf5bfa7f289.tar.gz |
MDEV-10010 - Recursive call to mysql_rwlock_rdlock for LOCK_system_variables_hash
Avoid recursive LOCK_system_variables_hash acquisition in
intern_sys_var_ptr() by pre-syncing dynamic session variables.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 8ec44bad966..ae3874506dd 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -7209,6 +7209,17 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond) COND *partial_cond= make_cond_for_info_schema(thd, cond, tables); mysql_rwlock_rdlock(&LOCK_system_variables_hash); + + /* + Avoid recursive LOCK_system_variables_hash acquisition in + intern_sys_var_ptr() by pre-syncing dynamic session variables. + */ + if (scope == OPT_SESSION && + (!thd->variables.dynamic_variables_ptr || + global_system_variables.dynamic_variables_head > + thd->variables.dynamic_variables_head)) + sync_dynamic_session_variables(thd, true); + res= show_status_array(thd, wild, enumerate_sys_vars(thd, sorted_vars, scope), scope, NULL, "", tables->table, upper_case_names, partial_cond); |