summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index b7a75a0bdd6..9f912ff37c5 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5867,6 +5867,7 @@ void kill_one_thread(THD *thd, ulong id, bool only_kill_query)
my_error(error, MYF(0), id);
}
+
/* Clear most status variables */
static void refresh_status(void)
@@ -5876,17 +5877,6 @@ static void refresh_status(void)
{
if (ptr->type == SHOW_LONG)
*(ulong*) ptr->value= 0;
- else if (ptr->type == SHOW_KEY_CACHE_LONG)
- {
- /*
- Reset value in 'default' key cache.
- This needs to be recoded when we have thread specific key values
- */
- char *value= (((char*) sql_key_cache) +
- (uint) ((char*) (ptr->value) -
- (char*) &dflt_key_cache_var));
- *(ulong*) value= 0;
- }
else if (ptr->type == SHOW_LONG_STATUS)
{
THD *thd= current_thd;
@@ -5895,6 +5885,8 @@ static void refresh_status(void)
bzero((char*) &thd->status_var, sizeof(thd->status_var));
}
}
+ /* Reset the counters of all key caches (default and named). */
+ process_key_caches(reset_key_cache_counters);
pthread_mutex_unlock(&LOCK_status);
}