Skip to content

DATE subtract with INTERVAL is not parsed #184

@cdmh

Description

@cdmh

This query from tpc-h doesn't parse, and reports an error at column 75, inside interval '75'.

SELECT * FROM lineitem where l_shipdate <= date '1998-12-01' - interval '75' day (3);

This code

    REQUIRE(hsql::SQLParser::parse(
        "SELECT * FROM lineitem where l_shipdate <= date '1998-12-01' - interval '75' day (3);",
        &parser_result) == true);
    if (!parser_result.isValid())
        std::cerr << parser_result.errorMsg() << " at column " << parser_result.errorColumn();

yields

syntax error, unexpected STRING, expecting end of file at column 75

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