Skip to content

SQL: Parse error from CAST+MAX+ALL combination #6430

@philrz

Description

@philrz

Despite the ALL support added in #6258, the following produces a parse error.

$ super -c "SELECT CAST(MAX(ALL 6) AS INTEGER);"
parse error at line 1, column 21:
SELECT CAST(MAX(ALL 6) AS INTEGER);
                === ^ ===

Details

Repro is with super commit 30f64bb. This is a simplification of a query from a sqllogictest (aka random/expr/slt_good_61/q10764).

Here's the query returning the expected result in Postgres.

$ psql postgres -c "SELECT CAST(MAX(ALL 6) AS INTEGER);"
 max 
-----
   6
(1 row)

It does parse in super if the ALL is dropped.

$ super -version
Version: 30f64bbac

$ super -c "SELECT CAST(MAX(6) AS INTEGER);"
{"CAST(MAX(6) AS int32)":6::int32}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions