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]);
}
When parser not set
trailing_commas=trueinParserOptionsor useBigQueryDialect, the following SQL will be wrongly parse instead of throw an error.In theory it should throw a error
relevant code