Skip to content

Parsing "@@" throws exception #1237

Closed

Description

@Aceto1

Describe the bug
When parsing the below SQL an exception with the message: "Not yet supprted" is thrown. This is totally valid MariaDB SQL Syntax that runs just fine when directly executing on the database.

To Reproduce
Steps to reproduce the behavior:

  1. SQL: "SET @@global.time_zone = '01:00'"
  2. Parsing this SQL using JSqlParser with this statements
  3. Exception:
Encountered unexpected token: "@@" "@@"
    at line 1, column 5.

Was expecting one of:

    "ACTION"
    "ANY"
    "BYTE"
    "CASCADE"
    "CAST"
    "CHANGE"
    "CHAR"
    "CHARACTER"
    "COLUMN"
    "COLUMNS"
    "COMMENT"
    "COMMIT"
    "CREATE"
    "CYCLE"
    "DESC"
    "DESCRIBE"
    "DISABLE"
    "DIV"
    "DO"
    "DOUBLE"
    "DUPLICATE"
    "ENABLE"
    "END"
    "EXCLUDE"
    "EXTRACT"
    "FALSE"
    "FIRST"
    "FN"
    "FOLLOWING"
    "FORMAT"
    "GROUP"
    "IF"
    "INDEX"
    "INSERT"
    "INTERVAL"
    "ISNULL"
    "KEY"
    "LAST"
    "LEFT"
    "LIMIT"
    "MATERIALIZED"
    "NEXTVAL"
    "NO"
    "NOLOCK"
    "NULLS"
    "OF"
    "OFFSET"
    "ON"
    "OPEN"
    "OPTIMIZE"
    "ORDER"
    "OVER"
    "PARTITION"
    "PATH"
    "PERCENT"
    "PRECISION"
    "PRIMARY"
    "PRIOR"
    "PROCEDURE"
    "PUBLIC"
    "RANGE"
    "READ"
    "REPLACE"
    "RIGHT"
    "ROW"
    "ROWS"
    "SCHEMA"
    "SEPARATOR"
    "SEQUENCE"
    "SESSION"
    "SET"
    "SIBLINGS"
    "SIZE"
    "START"
    "TABLE"
    "TABLES"
    "TEMP"
    "TEMPORARY"
    "TO"
    "TOP"
    "TRUE"
    "TRUNCATE"
    "TYPE"
    "UNSIGNED"
    "VALIDATE"
    "VALUE"
    "VALUES"
    "VIEW"
    "XML"
    "ZONE"
    <K_DATETIMELITERAL>
    <K_DATE_LITERAL>
    <S_IDENTIFIER>
    <S_QUOTED_IDENTIFIER>

Expected behavior
The statement should be parsed just fine, since it is a valid SQL statement for MariaDB

System

  • MariaDB 10.5.8
  • Java 11
  • JSqlParser version 4.0

Activity

  1. changed the title [-]MariaDB "@@" throws exception[/-] [+]Parsing "@@" throws exception[/+] on Jun 22, 2021
  2. wumpz commented on Jun 27, 2021

    @wumpz
    Member

    This kind of "user variable" is not yet supported.

  3. added a commit that references this issue on Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions