Skip to content

SQL is parsed incorrectly when trailing_commas is not set #1064

Description

@Taylor-lagrange

When parser not set trailing_commas=true in ParserOptions or use BigQueryDialect, the following SQL will be wrongly parse instead of throw an error.

SELECT foo, bar, FROM baz

-- Will be wrongly parse instead of throw an error.

SELECT foo, bar, FROM AS baz

In theory it should throw a error

relevant code

#[test]
fn parse_range_select() {
    let statements = Parser::parse_sql(&GenericDialect {}, "SELECT foo, bar, FROM baz").unwrap();
    println!("{}", statements[0]);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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