diff options
Diffstat (limited to 'sql/sql_reload.cc')
-rw-r--r-- | sql/sql_reload.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index bf38af78536..ea4f53187f9 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -274,6 +274,35 @@ bool reload_acl_and_cache(THD *thd, unsigned long options, #endif if (options & REFRESH_USER_RESOURCES) reset_mqh((LEX_USER *) NULL, 0); /* purecov: inspected */ + if (options & REFRESH_TABLE_STATS) + { + mysql_mutex_lock(&LOCK_global_table_stats); + free_global_table_stats(); + init_global_table_stats(); + mysql_mutex_unlock(&LOCK_global_table_stats); + } + if (options & REFRESH_INDEX_STATS) + { + mysql_mutex_lock(&LOCK_global_index_stats); + free_global_index_stats(); + init_global_index_stats(); + mysql_mutex_unlock(&LOCK_global_index_stats); + } + if (options & (REFRESH_USER_STATS | REFRESH_CLIENT_STATS)) + { + mysql_mutex_lock(&LOCK_global_user_client_stats); + if (options & REFRESH_USER_STATS) + { + free_global_user_stats(); + init_global_user_stats(); + } + if (options & REFRESH_CLIENT_STATS) + { + free_global_client_stats(); + init_global_client_stats(); + } + mysql_mutex_unlock(&LOCK_global_user_client_stats); + } *write_to_binlog= tmp_write_to_binlog; /* If the query was killed then this function must fail. |