Bug #11780 Query cache: wrong error message
Submitted: 6 Jul 2005 16:54 Modified: 11 May 2006 17:16
Reporter: Stefan Hinz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0.7 OS:Linux (Linux)
Assigned to: Paul DuBois CPU Architecture:Any

[6 Jul 2005 16:54] Stefan Hinz
Description:
The query cache size needs a minimum size to allocate its structures. For example, you cannot set it to 10 or 100; it will automatically be reset to zero, and a warning is being issued.
That warning is incorrect (at least it is with the precompiled binary 5.0.7 I used for Linux). The minimum query cache size for that version is 40984, but the warning says it's 40960. See below under How to repeat.

How to repeat:
mysql> show variables like 'query_cache_size';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| query_cache_size | 0     |
+------------------+-------+
1 row in set (0.00 sec)

mysql> set global query_cache_size = 41983;
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> show warnings;
+---------+------+-----------------------------------------------------------------+
| Level   | Code | Message
            |
+---------+------+-----------------------------------------------------------------+
| Warning | 1282 | Query cache failed to set size 40960; new query cache
size is 0 |
+---------+------+-----------------------------------------------------------------+
1 row in set (0.06 sec)

mysql> set global query_cache_size = 41984;
Query OK, 0 rows affected (0.01 sec)

mysql> show variables like 'query_cache_size';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| query_cache_size | 41984 |
+------------------+-------+
1 row in set (0.00 sec)

mysql>

Suggested fix:
Make the warning report the correct value (14984 in my case).
[5 Aug 2005 6:31] Georg Richter
related to bug #10516
[11 May 2006 9:32] Georgi Kodinov
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

Actually the query_cache_size must be specified in increments of 1024. So if you give it an arbitrary value it will round it down to a multiple of 1024. The error message shows the rounded down value that would have been set.
[11 May 2006 17:12] Paul DuBois
Looks like this is really a documentation problem, not
a server bug. Resetting category and assigning to myself.
[11 May 2006 17:16] Paul DuBois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).