Bug #2086 Misleading error message from SELECT var_name
Submitted: 10 Dec 2003 15:56 Modified: 18 Dec 2003 6:18
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.1 OS:Any (Any)
Assigned to: Bugs System CPU Architecture:Any

[10 Dec 2003 15:56] Paul DuBois
Description:
The server produces a misleading error message
when attempting to select the value of a variable.

This works properly:

mysql> SELECT @@global.default.key_buffer_size;
+----------------------------------+
| @@global.default.key_buffer_size |
+----------------------------------+
|                          8388600 |
+----------------------------------+
1 row in set (0.36 sec)

This does not:

mysql> SELECT @@session.default.key_buffer_size;
ERROR 1229 (HY000): Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET 
GLOBAL

Okay, well, it's true that this variable doesn't
have a session form, but the error message is
incorrect -- I'm attempting to *retrieve* the
value, not *set* it.

How to repeat:
See above.
[17 Dec 2003 4:49] Victor Vagin
There are new error messages:

mysql> SELECT @@session.key_buffer_size;
ERROR 1238: Variable 'key_buffer_size' is a GLOBAL variable
mysql> SET @@session.key_buffer_size=1;
ERROR 1229: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
mysql> select @@global.timestamp;
ERROR 1238: Variable 'timestamp' is a LOCAL variable
mysql> set @@global.timestamp=1;
ERROR 1228: Variable 'timestamp' is a LOCAL variable and can't be used with SET GLOBAL
[18 Dec 2003 6:18] Victor Vagin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html