Skip to content

Support brackets #126

@janmotl

Description

@janmotl

If I attempt to parse following statement:
(SELECT 1)
With this code:

Statement stmt = CCJSqlParserUtil.parse("(SELECT 1)");

I get following error:

Encountered " "(" "( "" at line 1, column 1.
Was expecting one of:
    "WITH" ...
    "SELECT" ...
    "SELECT" ...

However, the mentioned statement executes correctly on:

  • PostgreSQL
  • MySQL
  • MS SQL SERVER
  • Oracle (with: (select 1 from dual))

Use case: Sometimes I want to parse just a portion of a long statement. And if I am not careful enough, parentheses can leak into JSqlParser.

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