Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/dialect/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ impl Dialect for GenericDialect {
true
}

fn supports_projection_trailing_commas(&self) -> bool {
true
}

fn supports_asc_desc_in_column_definition(&self) -> bool {
true
}
Expand Down
9 changes: 1 addition & 8 deletions tests/sqlparser_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11125,16 +11125,9 @@ fn parse_trailing_comma() {
);
trailing_commas.verified_stmt(r#"SELECT "from" FROM "from""#);

// doesn't allow any trailing commas
// doesn't allow all trailing commas
let trailing_commas = TestedDialects::new(vec![Box::new(GenericDialect {})]);

assert_eq!(
trailing_commas
.parse_sql_statements("SELECT name, age, from employees;")
.unwrap_err(),
ParserError::ParserError("Expected an expression, found: from".to_string())
);

assert_eq!(
trailing_commas
.parse_sql_statements("REVOKE USAGE, SELECT, ON p TO u")
Expand Down