summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2005-09-14 09:56:49 +0200
committerunknown <ingo@mysql.com>2005-09-14 09:56:49 +0200
commit07b61cbb251d7b233abc47b4dd235930fbe4af63 (patch)
tree62a310b25cf6ff423d024f6c9d99a3f8e152eff5
parent3884629d888c48ec113de6463db569c9edc907d6 (diff)
downloadmariadb-git-07b61cbb251d7b233abc47b4dd235930fbe4af63.tar.gz
Bug#12920 - key_read_requests counter appears to re-set
Enlarged the counter variables to ulonglong.
-rw-r--r--include/my_sys.h4
-rw-r--r--myisam/mi_test2.c6
-rw-r--r--mysys/mf_keycache.c12
-rw-r--r--sql/mysqld.cc8
-rw-r--r--sql/sql_test.cc15
5 files changed, 25 insertions, 20 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index d6104a6a3a9..21fd58b2220 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -222,8 +222,8 @@ extern char *get_charsets_dir(char *buf);
/* statistics */
-extern ulong _my_cache_w_requests,_my_cache_write,_my_cache_r_requests,
- _my_cache_read;
+extern ulonglong _my_cache_w_requests, _my_cache_write;
+extern ulonglong _my_cache_r_requests, _my_cache_read;
extern ulong _my_blocks_used,_my_blocks_changed;
extern uint key_cache_block_size;
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
diff --git a/myisam/mi_test2.c b/myisam/mi_test2.c
index 11253f1fdee..89fc967ecf5 100644
--- a/myisam/mi_test2.c
+++ b/myisam/mi_test2.c
@@ -812,12 +812,14 @@ end:
puts("blobs used");
printf("key cache status: \n\
blocks used:%10lu\n\
+not flushed:%10lu\n\
w_requests: %10lu\n\
writes: %10lu\n\
r_requests: %10lu\n\
reads: %10lu\n",
- _my_blocks_used,_my_cache_w_requests, _my_cache_write,
- _my_cache_r_requests,_my_cache_read);
+ _my_blocks_used, _my_blocks_changed,
+ (ulong) _my_cache_w_requests, (ulong) _my_cache_write,
+ (ulong) _my_cache_r_requests, (ulong) _my_cache_read);
}
end_key_cache();
if (blob_buffer)
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 977ca6b11a7..0f8eb7e6f65 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -62,8 +62,8 @@ static int _my_disk_blocks;
static uint _my_disk_blocks_used, _my_hash_blocks;
static uint key_cache_shift;
ulong _my_blocks_used,_my_blocks_changed;
-ulong _my_cache_w_requests,_my_cache_write,_my_cache_r_requests,
- _my_cache_read;
+ulonglong _my_cache_w_requests, _my_cache_write;
+ulonglong _my_cache_r_requests, _my_cache_read;
uint key_cache_block_size=DEFAULT_KEYCACHE_BLOCK_SIZE;
static byte HUGE_PTR *_my_block_mem;
static SEC_LINK *changed_blocks[CHANGED_BLOCKS_HASH];
@@ -192,9 +192,11 @@ void end_key_cache(void)
key_cache_inited=0;
_my_hash_blocks=_my_blocks_used=0;
DBUG_PRINT("status",
- ("used: %d changed: %d w_requests: %ld writes: %ld r_requests: %ld reads: %ld",
- _my_blocks_used,_my_blocks_changed,_my_cache_w_requests,
- _my_cache_write,_my_cache_r_requests,_my_cache_read));
+ ("used: %d changed: %d w_requests: %lu writes: %lu "
+ "r_requests: %lu reads: %lu",
+ _my_blocks_used, _my_blocks_changed,
+ (ulong) _my_cache_w_requests, (ulong) _my_cache_write,
+ (ulong) _my_cache_r_requests, (ulong) _my_cache_read));
DBUG_VOID_RETURN;
} /* end_key_cache */
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 17157d0ebe2..18f07798e84 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4532,10 +4532,10 @@ struct show_var_st status_vars[]= {
{"Handler_update", (char*) &ha_update_count, SHOW_LONG},
{"Handler_write", (char*) &ha_write_count, SHOW_LONG},
{"Key_blocks_used", (char*) &_my_blocks_used, SHOW_LONG_CONST},
- {"Key_read_requests", (char*) &_my_cache_r_requests, SHOW_LONG},
- {"Key_reads", (char*) &_my_cache_read, SHOW_LONG},
- {"Key_write_requests", (char*) &_my_cache_w_requests, SHOW_LONG},
- {"Key_writes", (char*) &_my_cache_write, SHOW_LONG},
+ {"Key_read_requests", (char*) &_my_cache_r_requests, SHOW_LONGLONG},
+ {"Key_reads", (char*) &_my_cache_read, SHOW_LONGLONG},
+ {"Key_write_requests", (char*) &_my_cache_w_requests, SHOW_LONGLONG},
+ {"Key_writes", (char*) &_my_cache_write, SHOW_LONGLONG},
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
{"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use, SHOW_LONG_CONST},
{"Not_flushed_key_blocks", (char*) &_my_blocks_changed, SHOW_LONG_CONST},
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index a217d40246f..297bb7a5dd3 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -195,6 +195,8 @@ TEST_join(JOIN *join)
void mysql_print_status(THD *thd)
{
char current_dir[FN_REFLEN];
+ char llbuff[22];
+
printf("\nStatus information:\n\n");
my_getwd(current_dir, sizeof(current_dir),MYF(0));
printf("Current dir: %s\n", current_dir);
@@ -214,13 +216,12 @@ void mysql_print_status(THD *thd)
pthread_mutex_lock(&THR_LOCK_keycache);
printf("key_cache status:\n\
blocks used:%10lu\n\
-not flushed:%10lu\n\
-w_requests: %10lu\n\
-writes: %10lu\n\
-r_requests: %10lu\n\
-reads: %10lu\n",
- _my_blocks_used,_my_blocks_changed,_my_cache_w_requests,
- _my_cache_write,_my_cache_r_requests,_my_cache_read);
+not flushed:%10lu\n",
+ _my_blocks_used, _my_blocks_changed);
+ printf("w_requests: %10s\n", llstr(_my_cache_w_requests, llbuff));
+ printf("writes: %10s\n", llstr(_my_cache_write, llbuff));
+ printf("r_requests: %10s\n", llstr(_my_cache_r_requests, llbuff));
+ printf("reads: %10s\n", llstr(_my_cache_read, llbuff));
pthread_mutex_unlock(&THR_LOCK_keycache);
if (thd)