Commit 07b61cbb authored by unknown's avatar unknown

Bug#12920 - key_read_requests counter appears to re-set

Enlarged the counter variables to ulonglong.

parent 3884629d
......@@ -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;
......
......@@ -812,12 +812,14 @@ int main(int argc, char *argv[])
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)
......
......@@ -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 */
......
......@@ -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},
......
......@@ -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)
......
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