You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e6c72e6
Browse filesBrowse the repository at this point in the historyBrowse files
MySQL reads the name after "@@" in its MY_LEX_IDENT_OR_KEYWORD state,
which fails on an empty name. Only a backtick skips that state. So
"SELECT @@ version" and "SELECT @@'version'" are syntax errors in MySQL,
while "SELECT @@`version`" works. Both lexers accepted all of them.
Treat "@@" followed by neither a name character nor a backtick as
invalid input, as MySQL does.
The driver stores CHECK and DEFAULT expressions by joining their tokens
with spaces, and it parses them again on ALTER TABLE. Join "@@" and the
variable name without a space, so that "CHECK (a < @@max_connections)"
isn't stored as "a < @@ max_connections", which no longer parses. MySQL
rejects variables in these expressions, but the driver accepts them.
See: https://github.com/mysql/mysql-server/blob/mysql-8.4.10/sql/sql_lex.cc
0 commit comments