Skip to content

Union with selects wrapped in parenthesis doesn't parse on 4.1 #1094

Closed
@tomershay

Description

@tomershay

Describe the bug
The following query fails parsing in v4.1, while it worked with previous versions.
It seems that the parser fails only when the two queries in the union are wrapped with parenthesis.

Parser fails with:

SELECT
  *
FROM
  (
    (
      SELECT
        A
      FROM
        tbl
    )
    UNION
      DISTINCT (
        SELECT
          B
        FROM
          tbl2
      )
  ) AS union1

Parser doesn't fail with:

SELECT
  *
FROM
  (
      SELECT
        A
      FROM
        tbl
    UNION
      DISTINCT
        SELECT
          B
        FROM
          tbl2
  ) AS union1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions