1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Bug#25132 disabled query cache: Qcache_free_blocks = 1

The initial value of free memory blocks in 0. When the query cache is enabled 
a new memory block gets allocated and is assigned number 1. The free memory
block is later split each time query cache memory is allocated for new blocks.
This means that the free memory block counter won't be reduced to zero when
the number of allocated blocks are zero, but rather one. To avoid confusion
this patch changes this behavior so that the free memory block counter is
reset to zero when the query cache is disabled.
Note that when the query cache is enabled and resized the free memory block
counter was still calculated correctly.


mysql-test/r/query_cache.result:
  test case
mysql-test/t/query_cache.test:
  test case
sql/sql_cache.cc:
  Restore the memory block count to 0 for consistency.
This commit is contained in:
unknown
2008-03-06 12:40:46 +01:00
parent a89ba0c680
commit c184cd6320
3 changed files with 20 additions and 0 deletions

View File

@ -1794,6 +1794,7 @@ void Query_cache::make_disabled()
query_cache_size= 0;
queries_blocks= 0;
free_memory= 0;
free_memory_blocks= 0;
bins= 0;
steps= 0;
cache= 0;