Bug #1948 system variable query_prealloc_size can be only global
Submitted: 25 Nov 2003 7:32 Modified: 3 Feb 2004 4:04
Reporter: Konstantin Osipov (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0 OS:
Assigned to: Konstantin Osipov CPU Architecture:Any

[25 Nov 2003 7:32] Konstantin Osipov
Description:
MySQL server variable query_prealloc_size is not a session variable: it can be only global.
SET query_prealloc_size=value does not change anything, and SET GLOBAL query_prealloc_size=value affects only new connections.
This is not reflected in our documentation.

How to repeat:
SET query_prealloc_size=anyvalue and watch that real allocation does not take place.

Suggested fix:
Either remove query_prealloc_size from list of session variables, or do really perform prealloc when this variable is set.
Also add full description of the variable to the docs.
[25 Nov 2003 7:34] Konstantin Osipov
Current description for query_prealloc_size can be found here:
http://www.mysql.com/doc/en/SHOW_VARIABLES.html
[25 Nov 2003 7:39] Konstantin Osipov
The same is true for 'query_alloc_block_size'.
[10 Dec 2003 15:37] Paul DuBois
I'm confused by this bug report.  There are two issues.

1) Konstantin says:
----
How to repeat:
SET query_prealloc_size=anyvalue and watch that real allocation does
not take place.
Suggested fix:
Either remove query_prealloc_size from list of session variables, or do
really perform prealloc when this variable is set.
Also add full description of the variable to the docs.
----
But I find that if I set query_prealloc_size to some value, and then
do SHOW VARIABLES, the value *has* been set. It may be that it is
not *used*, but that is a different question. What is meant here?

2) If these variables really are global only (which is apparently
the intent), then there is a server bug that cannot be addressed
solely as a doc issue.  If they are global only, then attempting to
set them without explicitly specifying GLOBAL should result in
an error. That is, they should be treated the same way a variable
like key_buffer_size (also a global-only variable) is treated:

mysql> SET key_buffer_size = 100000;
ERROR 1229: Variable 'key_buffer_size' is a GLOBAL variable
and should be set with SET GLOBAL

Please confirm whether or not I am correct and advise me how
to proceed. Thanks.
[15 Dec 2003 13:16] Paul DuBois
Konstantin and I had a chat about this issue. The result is
that we believe the behavior should be as follows:

paul: - query_prealloc_size exists as a global variable, and can be changed with SET GLOBAL 
query_prealloc_size = value.
paul: - Changes that are made that way affect only new connections.
paul: - When a client connects, it has a session query_prealloc_size value that is initialized from 
the current global value.
paul: - The session value is read-only; the client cannot change it.

I will reassign this report to Konstantin. After he makes the changes, he'll
reassign to me as a docs issue.
[3 Feb 2004 4:04] Konstantin Osipov
Fixed in 4.0.18 (bk commit - 4.0 tree (konstantin:1.1695)