summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2016-06-27 15:01:22 +0400
committerSergey Vojtovich <svoj@mariadb.org>2016-07-08 23:38:05 +0400
commitecb27d2650da546c53bf7ff709cc6bf5bfa7f289 (patch)
tree64b9e34560c78468837c43c7c2333c1cc556e40b /sql/sql_show.cc
parent95c286cedf4b9330240a0a91a9fc3e58a17782b9 (diff)
downloadmariadb-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.cc11
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);