diff options
author | unknown <timour@mysql.com> | 2005-01-21 17:38:36 +0200 |
---|---|---|
committer | unknown <timour@mysql.com> | 2005-01-21 17:38:36 +0200 |
commit | 888ee151b52014196dade212de23ebe344635d3e (patch) | |
tree | 4faccbef9f677e58e0845832b55b767827401dd5 /mysys/mf_keycache.c | |
parent | 90f94790986ba8c3938b575d8e5592a7a06471db (diff) | |
parent | 7f4324a58d5f8c17a41d31d31e89649c55ee1c35 (diff) | |
download | mariadb-git-888ee151b52014196dade212de23ebe344635d3e.tar.gz |
Merge of fix for BUG#4258 from 4.1.
Needs additional manual merge.
mysys/mf_keycache.c:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_parse.cc:
Properly resetting all key cache counters.
sql/sql_show.cc:
Needs manual merge.
Diffstat (limited to 'mysys/mf_keycache.c')
-rw-r--r-- | mysys/mf_keycache.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index bf7ed7ab6b6..5c9d1434b0c 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -2444,6 +2444,41 @@ static int flush_all_key_blocks(KEY_CACHE *keycache) } +/* + Reset the counters of a key cache. + + SYNOPSIS + reset_key_cache_counters() + name the name of a key cache + key_cache pointer to the key kache to be reset + + DESCRIPTION + This procedure is used by process_key_caches() to reset the counters of all + currently used key caches, both the default one and the named ones. + + RETURN + 0 on success (always because it can't fail) +*/ + +int reset_key_cache_counters(const char *name, KEY_CACHE *key_cache) +{ + DBUG_ENTER("reset_key_cache_counters"); + if (!key_cache->key_cache_inited) + { + DBUG_PRINT("info", ("Key cache %s not initialized.", name)); + DBUG_RETURN(0); + } + DBUG_PRINT("info", ("Resetting counters for key cache %s.", name)); + + key_cache->global_blocks_changed= 0; /* Key_blocks_not_flushed */ + key_cache->global_cache_r_requests= 0; /* Key_read_requests */ + key_cache->global_cache_read= 0; /* Key_reads */ + key_cache->global_cache_w_requests= 0; /* Key_write_requests */ + key_cache->global_cache_write= 0; /* Key_writes */ + DBUG_RETURN(0); +} + + #ifndef DBUG_OFF /* Test if disk-cache is ok |