Commit 73143077 authored by ingo@mysql.com's avatar ingo@mysql.com

Bug#12920 - key_read_requests counter appears to re-set

Enlarged the counter variables to ulonglong.
parent e31c488d
...@@ -222,8 +222,8 @@ extern char *get_charsets_dir(char *buf); ...@@ -222,8 +222,8 @@ extern char *get_charsets_dir(char *buf);
/* statistics */ /* statistics */
extern ulong _my_cache_w_requests,_my_cache_write,_my_cache_r_requests, extern ulonglong _my_cache_w_requests, _my_cache_write;
_my_cache_read; extern ulonglong _my_cache_r_requests, _my_cache_read;
extern ulong _my_blocks_used,_my_blocks_changed; extern ulong _my_blocks_used,_my_blocks_changed;
extern uint key_cache_block_size; extern uint key_cache_block_size;
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
......
...@@ -812,12 +812,14 @@ end: ...@@ -812,12 +812,14 @@ end:
puts("blobs used"); puts("blobs used");
printf("key cache status: \n\ printf("key cache status: \n\
blocks used:%10lu\n\ blocks used:%10lu\n\
not flushed:%10lu\n\
w_requests: %10lu\n\ w_requests: %10lu\n\
writes: %10lu\n\ writes: %10lu\n\
r_requests: %10lu\n\ r_requests: %10lu\n\
reads: %10lu\n", reads: %10lu\n",
_my_blocks_used,_my_cache_w_requests, _my_cache_write, _my_blocks_used, _my_blocks_changed,
_my_cache_r_requests,_my_cache_read); (ulong) _my_cache_w_requests, (ulong) _my_cache_write,
(ulong) _my_cache_r_requests, (ulong) _my_cache_read);
} }
end_key_cache(); end_key_cache();
if (blob_buffer) if (blob_buffer)
......
...@@ -62,8 +62,8 @@ static int _my_disk_blocks; ...@@ -62,8 +62,8 @@ static int _my_disk_blocks;
static uint _my_disk_blocks_used, _my_hash_blocks; static uint _my_disk_blocks_used, _my_hash_blocks;
static uint key_cache_shift; static uint key_cache_shift;
ulong _my_blocks_used,_my_blocks_changed; ulong _my_blocks_used,_my_blocks_changed;
ulong _my_cache_w_requests,_my_cache_write,_my_cache_r_requests, ulonglong _my_cache_w_requests, _my_cache_write;
_my_cache_read; ulonglong _my_cache_r_requests, _my_cache_read;
uint key_cache_block_size=DEFAULT_KEYCACHE_BLOCK_SIZE; uint key_cache_block_size=DEFAULT_KEYCACHE_BLOCK_SIZE;
static byte HUGE_PTR *_my_block_mem; static byte HUGE_PTR *_my_block_mem;
static SEC_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; static SEC_LINK *changed_blocks[CHANGED_BLOCKS_HASH];
...@@ -192,9 +192,11 @@ void end_key_cache(void) ...@@ -192,9 +192,11 @@ void end_key_cache(void)
key_cache_inited=0; key_cache_inited=0;
_my_hash_blocks=_my_blocks_used=0; _my_hash_blocks=_my_blocks_used=0;
DBUG_PRINT("status", DBUG_PRINT("status",
("used: %d changed: %d w_requests: %ld writes: %ld r_requests: %ld reads: %ld", ("used: %d changed: %d w_requests: %lu writes: %lu "
_my_blocks_used,_my_blocks_changed,_my_cache_w_requests, "r_requests: %lu reads: %lu",
_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));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} /* end_key_cache */ } /* end_key_cache */
......
...@@ -4532,10 +4532,10 @@ struct show_var_st status_vars[]= { ...@@ -4532,10 +4532,10 @@ struct show_var_st status_vars[]= {
{"Handler_update", (char*) &ha_update_count, SHOW_LONG}, {"Handler_update", (char*) &ha_update_count, SHOW_LONG},
{"Handler_write", (char*) &ha_write_count, SHOW_LONG}, {"Handler_write", (char*) &ha_write_count, SHOW_LONG},
{"Key_blocks_used", (char*) &_my_blocks_used, SHOW_LONG_CONST}, {"Key_blocks_used", (char*) &_my_blocks_used, SHOW_LONG_CONST},
{"Key_read_requests", (char*) &_my_cache_r_requests, SHOW_LONG}, {"Key_read_requests", (char*) &_my_cache_r_requests, SHOW_LONGLONG},
{"Key_reads", (char*) &_my_cache_read, SHOW_LONG}, {"Key_reads", (char*) &_my_cache_read, SHOW_LONGLONG},
{"Key_write_requests", (char*) &_my_cache_w_requests, SHOW_LONG}, {"Key_write_requests", (char*) &_my_cache_w_requests, SHOW_LONGLONG},
{"Key_writes", (char*) &_my_cache_write, SHOW_LONG}, {"Key_writes", (char*) &_my_cache_write, SHOW_LONGLONG},
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG}, {"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
{"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use, SHOW_LONG_CONST}, {"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use, SHOW_LONG_CONST},
{"Not_flushed_key_blocks", (char*) &_my_blocks_changed, SHOW_LONG_CONST}, {"Not_flushed_key_blocks", (char*) &_my_blocks_changed, SHOW_LONG_CONST},
......
...@@ -195,6 +195,8 @@ TEST_join(JOIN *join) ...@@ -195,6 +195,8 @@ TEST_join(JOIN *join)
void mysql_print_status(THD *thd) void mysql_print_status(THD *thd)
{ {
char current_dir[FN_REFLEN]; char current_dir[FN_REFLEN];
char llbuff[22];
printf("\nStatus information:\n\n"); printf("\nStatus information:\n\n");
my_getwd(current_dir, sizeof(current_dir),MYF(0)); my_getwd(current_dir, sizeof(current_dir),MYF(0));
printf("Current dir: %s\n", current_dir); printf("Current dir: %s\n", current_dir);
...@@ -214,13 +216,12 @@ void mysql_print_status(THD *thd) ...@@ -214,13 +216,12 @@ void mysql_print_status(THD *thd)
pthread_mutex_lock(&THR_LOCK_keycache); pthread_mutex_lock(&THR_LOCK_keycache);
printf("key_cache status:\n\ printf("key_cache status:\n\
blocks used:%10lu\n\ blocks used:%10lu\n\
not flushed:%10lu\n\ not flushed:%10lu\n",
w_requests: %10lu\n\ _my_blocks_used, _my_blocks_changed);
writes: %10lu\n\ printf("w_requests: %10s\n", llstr(_my_cache_w_requests, llbuff));
r_requests: %10lu\n\ printf("writes: %10s\n", llstr(_my_cache_write, llbuff));
reads: %10lu\n", printf("r_requests: %10s\n", llstr(_my_cache_r_requests, llbuff));
_my_blocks_used,_my_blocks_changed,_my_cache_w_requests, printf("reads: %10s\n", llstr(_my_cache_read, llbuff));
_my_cache_write,_my_cache_r_requests,_my_cache_read);
pthread_mutex_unlock(&THR_LOCK_keycache); pthread_mutex_unlock(&THR_LOCK_keycache);
if (thd) if (thd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment