Skip to content

Parsing exception for nested WITH  #1123

@rhuddbiz

Description

@rhuddbiz

Describe the bug
Postgres supports nested WITH in SQL Statement

To Reproduce
Steps to reproduce the behavior:

WITH a AS ( WITH a AS ( select 1 ) SELECT 2 ) SELECT * from a

java.sql.SQLException: Encountered unexpected token: "WITH" "WITH"
at line 1, column 13.

Was expecting one of:

"("
"VALUES"
<K_SELECT>

Expected behavior
Running SQL Query in Postgres returns -> single row with value "2"

System

  • Testing against Postgres
  • Java Version 11
    Failed with JSqlParser version 3.2 and 4.0

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