1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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.
This commit is contained in:
timour@mysql.com
2005-01-19 12:55:54 +02:00
parent 594ee4c018
commit 7fb0de20f3
7 changed files with 50 additions and 24 deletions

View File

@@ -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);
}