Details
-
New Feature
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
Having three error codes for "wrong scope for variable" seems extraneous; it's also not future-proof.
- ER_GLOBAL_VARIABLE
- ER_LOCAL_VARIABLE
- ER_INCORRECT_GLOBAL_LOCAL_VAR
The difference between the errors for SELECT @@... and SET @@...-... can look inconsistent to users who expect the @@variable syntax to be "universal":
SELECT @@SESSION.connect_timeout; |
--> ER_INCORRECT_GLOBAL_LOCAL_VAR: Variable 'connect_timeout' is a GLOBAL variable
|
SET @@SESSION.connect_timeout= 12; |
--> ER_GLOBAL_VARIABLE: Variable 'connect_timeout' is a GLOBAL variable and should be set with SET GLOBAL
|
|
SELECT @@GLOBAL.default_master_connection; |
--> ER_INCORRECT_GLOBAL_LOCAL_VAR: Variable 'default_master_connection' is a SESSION variable
|
SET @@GLOBAL.default_master_connection= ''; |
--> ER_LOCAL_VARIABLE: Variable 'default_master_connection' is a SESSION variable and can't be used with SET GLOBAL |