diff options
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1dd15398cd1..c84e1f7ee56 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5997,6 +5997,10 @@ The minimum value for this variable is 4096.", }; +/* + Variables shown by SHOW STATUS in alphabetical order +*/ + struct show_var_st status_vars[]= { {"Aborted_clients", (char*) &aborted_threads, SHOW_LONG}, {"Aborted_connects", (char*) &aborted_connects, SHOW_LONG}, @@ -7466,15 +7470,19 @@ void refresh_status(THD *thd) { pthread_mutex_lock(&LOCK_status); - /* We must update the global status before cleaning up the thread */ + /* Add thread's status variabes to global status */ add_to_status(&global_status_var, &thd->status_var); + + /* Reset thread's status variables */ bzero((char*) &thd->status_var, sizeof(thd->status_var)); + /* Reset some global variables */ for (struct show_var_st *ptr=status_vars; ptr->name; ptr++) { if (ptr->type == SHOW_LONG) *(ulong*) ptr->value= 0; } + /* Reset the counters of all key caches (default and named). */ process_key_caches(reset_key_cache_counters); pthread_mutex_unlock(&LOCK_status); |