Below is the list of changes that have just been committed into a local
5.0 repository of thek. When thek does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-03-06 12:40:46+01:00, thek@adventure.(none) +3 -0
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@stripped, 2008-03-06 12:40:45+01:00, thek@adventure.(none)
+10 -0
test case
mysql-test/t/query_cache.test@stripped, 2008-03-06 12:40:45+01:00, thek@adventure.(none) +9
-0
test case
sql/sql_cache.cc@stripped, 2008-03-06 12:40:45+01:00, thek@adventure.(none) +1 -0
Restore the memory block count to 0 for consistency.
diff -Nrup a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
--- a/mysql-test/r/query_cache.result 2007-08-21 17:47:03 +02:00
+++ b/mysql-test/r/query_cache.result 2008-03-06 12:40:45 +01:00
@@ -1650,6 +1650,16 @@ Variable_name Value
Qcache_queries_in_cache 1
DROP DATABASE bug30269;
DROP USER 'bug30269'@'localhost';
+#
+# Bug#25132 disabled query cache: Qcache_free_blocks = 1
+#
+set global query_cache_size=100000;
+set global query_cache_size=0;
+set global query_cache_type=0;
+show status like 'Qcache_free_blocks';
+Variable_name Value
+Qcache_free_blocks 0
+Restore default values.
set GLOBAL query_cache_type=default;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
diff -Nrup a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
--- a/mysql-test/t/query_cache.test 2007-08-21 17:47:03 +02:00
+++ b/mysql-test/t/query_cache.test 2008-03-06 12:40:45 +01:00
@@ -1251,6 +1251,15 @@ DROP DATABASE bug30269;
disconnect bug30269;
DROP USER 'bug30269'@'localhost';
+--echo #
+--echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1
+--echo #
+set global query_cache_size=100000;
+set global query_cache_size=0;
+set global query_cache_type=0;
+show status like 'Qcache_free_blocks';
+
+--echo Restore default values.
set GLOBAL query_cache_type=default;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
diff -Nrup a/sql/sql_cache.cc b/sql/sql_cache.cc
--- a/sql/sql_cache.cc 2007-10-01 12:44:28 +02:00
+++ b/sql/sql_cache.cc 2008-03-06 12:40:45 +01:00
@@ -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;
| Thread |
|---|
| • bk commit into 5.0 tree (thek:1.2594) BUG#25132 | kpettersson | 6 Mar |