Bug #108 SET @@globalvar=... causes error
Submitted: 27 Feb 2003 20:51 Modified: 3 Mar 2003 6:06
Reporter: Arjen Lentz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.10 OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[27 Feb 2003 20:51] Arjen Lentz
Description:
SET @@globalvar=... does not work (causes error 1229)
Works without @@, and session-level variables work fine too.

How to repeat:
# Setting a global var with @@ goes wrong:

mysql> SET GLOBAL @@query_cache_size=1000000;
ERROR 1229: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL

mysql> SET GLOBAL @@key_buffer_size=1000000;
ERROR 1229: Variable 'key_buffer_size' is a GLOBAL variable and should be set wi
th SET GLOBAL

# Setting a global var without @@ works ok:

mysql> SET GLOBAL query_cache_size=1000000;
Query OK, 0 rows affected (0.02 sec)

mysql> SET GLOBAL key_buffer_size=1000000;
Query OK, 0 rows affected (0.05 sec)

# Setting a session var with @@ works fine:

mysql> SET @@sort_buffer_size=1000000;
Query OK, 0 rows affected (0.00 sec)

Suggested fix:
After fixing the above, please add extra tests for this to check all possible combinations of syntax and global/session/etc.
[3 Mar 2003 6:06] Michael Widenius
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

This is not a bug.

SET @@variable_name=# is equal to

SET SESSION variable_name=#

Using GLOBAL before doesn't have any effect.

You should never mix the prefix SESSION or GLOBAL with the @@ variable names