Problem
When a SET statement assigns a bare ON or OFF keyword as a value (e.g., SET @@sql_auto_is_null = ON), the parser does not produce a NODE_VAR_ASSIGNMENT for it. These are valid MySQL syntax for boolean-like variables.
Failing test cases
SET @@sql_auto_is_null = ON
Expected: {"sql_auto_is_null": ["ON"]}
Got: {} (empty)
SET @@sql_safe_updates = ON
Expected: {"sql_safe_updates": ["ON"]}
Got: {} (empty)
Root cause
The expression parser in expression_parser.h does not recognize ON or OFF as valid expression start tokens. When the SetParser encounters = ON, it fails to parse the RHS expression and the entire assignment is skipped.
Expected behavior
ON and OFF should be recognized as valid expression values in the SET parser context, producing the same output as if they were identifiers.
Context
Discovered during integration testing into ProxySQL. Test suite: setparser_test_common.h, test arrays various[17], various[22].
Problem
When a SET statement assigns a bare
ONorOFFkeyword as a value (e.g.,SET @@sql_auto_is_null = ON), the parser does not produce aNODE_VAR_ASSIGNMENTfor it. These are valid MySQL syntax for boolean-like variables.Failing test cases
Root cause
The expression parser in
expression_parser.hdoes not recognizeONorOFFas valid expression start tokens. When the SetParser encounters= ON, it fails to parse the RHS expression and the entire assignment is skipped.Expected behavior
ONandOFFshould be recognized as valid expression values in the SET parser context, producing the same output as if they were identifiers.Context
Discovered during integration testing into ProxySQL. Test suite:
setparser_test_common.h, test arraysvarious[17],various[22].