Hi there,

I am writing a MySQL-compatible server that talks the MySQL protocol. Some 
clients are sending special queries to autoconfigure themselves, like "SELECT 
@@character_set_server". I would like to use calcite to parse such queries, but 
parsing fails with an exception, seemingly related to the usage of "@@" in 
variable names. Is this unsupported or am I doing something wrong?

The code:
> var config = SqlParser.Config.DEFAULT.withLex(Lex.MYSQL);
> var parser = SqlParser.create("SELECT @@character_set_server", config);
> var parsed = parser.parseQuery();

The exception: org.apache.calcite.sql.parser.SqlParseException: Lexical error 
at line 1, column 9.  Encountered: "@" (64), after : ""

Any help is appreciated!
Adolfo

Reply via email to