diff options
author | timour@mysql.com <> | 2005-01-19 12:55:54 +0200 |
---|---|---|
committer | timour@mysql.com <> | 2005-01-19 12:55:54 +0200 |
commit | 7fb0de20f3c60187331df1166a967183dc3b7bdd (patch) | |
tree | 75bcf07f1651331afc8970e24f80afa45a0bdead /sql/sql_parse.cc | |
parent | 594ee4c018aa736725b640092913eb29083c1696 (diff) | |
download | mariadb-git-7fb0de20f3c60187331df1166a967183dc3b7bdd.tar.gz |
Final patch for BUG#4285.
This patch collects all previous patches into one.
The main problem was due to that there is are two variables -
dflt_key_cache and sql_key_cache with have more or less duplicate
function. The reson for the bug was that the default value in the key
cache hash was set to dflt_key_cache, then sql_key_cache was set to a
new key cache object, and then dflt_key_cache was set to sql_key_cache
which was different from the dflt_key_cache_var. After sending SIGHUP,
the server was using the original default value for the key cache hash,
which was different from the actual key cache object used for the
default key cache.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c81aefc9cea..9eb4019b5d7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4946,6 +4946,7 @@ void kill_one_thread(THD *thd, ulong id) net_printf(thd,error,id); } + /* Clear most status variables */ static void refresh_status(void) @@ -4955,18 +4956,9 @@ 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; - } } + /* Reset the counters of all key caches (default and named). */ + process_key_caches(reset_key_cache_counters); pthread_mutex_unlock(&LOCK_status); } |