Bug #13334 Cannot set query_prealloc_size
Submitted: 20 Sep 2005 3:52 Modified: 20 Oct 2005 20:09
Reporter: Paul Laudanski Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:Ver 14.7 Distrib 4.1.14 OS:Linux (Linux)
Assigned to: Jim Winstead

[20 Sep 2005 3:52] Paul Laudanski
Description:
I changed the default value for query_prealloc_size from 8k to 16k and cannot reverse the change nor state a new one such as 4k.

How to repeat:
I changed query_prealloc_size from the default 8k to 16k in runtime:

SET GLOBAL query_prealloc_size = 16384;

When I do a SHOW GLOBAL VARIABLES, or SHOW VARIABLES, I get the value back for that key as 16384.

When I try to change it to 4096:

SET GLOBAL query_prealloc_size = 4096;

and do both of the SHOWs above, I still get 16384.  I cannot even set it in my.cnf:

query_prealloc_size = 4096

With a mysqld restart, it still shows up as 16384.

Suggested fix:
Mysql should take the effect:

SET GLOBAL query_prealloc_size = 4096;

in runtime, or successfully read it from the my.cnf:

query_prealloc_size = 4096
[26 Sep 2005 14:27] Hartmut Holzgraefe
query_prealloc_size is initialized as QUERY_ALLOC_PREALLOC_SIZE which is defined as 8192 but its minimum value is set to 16384, so *any* attemt to change it in my.cnf or using SET will set it to at least 16384

suggested fix: either increase the initial value to 16384 or lower the minimum value to 8192 so that both match
[27 Sep 2005 2:23] Paul Laudanski
I have tried selecting the system variable:

SELECT @@GLOBAL.QUERY_ALLOC_PREALLOC_SIZE;

And obtain this:

ERROR 1193 (HY000): Unknown system variable 'QUERY_ALLOC_PREALLOC_SIZE'

So I googled QUERY_ALLOC_PREALLOC_SIZE and found it to be in the MySQL 5 tree.  It doesn't appear to exist in MySQL 4.1.14.  If this is the case, how can I drop from

query_prealloc_size = 16384

to

query_prealloc_size = 8192

TIA
[3 Oct 2005 22:59] Brian Aker
Can we issue a warning?

Talk to Georg, he had a patch once for this.
[11 Oct 2005 2:38] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/30891
[19 Oct 2005 1:56] Jim Winstead
Fixed in 4.1.16 and 5.0.16.
[19 Oct 2005 2:43] Paul Laudanski
Thank you folks for looking into this and resolving it.  I look forward to testing it shortly.
[20 Oct 2005 20:09] Paul Dubois
Noted in 4.1.16, 5.0.16 changelogs.