mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-09 13:40:22 +00:00
Re-enable trailing commas in DCL (#1318)
This commit is contained in:
parent
0884dd920d
commit
f77192d4ec
2 changed files with 41 additions and 10 deletions
|
@ -8942,6 +8942,11 @@ fn parse_trailing_comma() {
|
|||
"CREATE TABLE employees (name TEXT, age INT)",
|
||||
);
|
||||
|
||||
trailing_commas.one_statement_parses_to(
|
||||
"GRANT USAGE, SELECT, INSERT, ON p TO u",
|
||||
"GRANT USAGE, SELECT, INSERT ON p TO u",
|
||||
);
|
||||
|
||||
trailing_commas.verified_stmt("SELECT album_id, name FROM track");
|
||||
|
||||
trailing_commas.verified_stmt("SELECT * FROM track ORDER BY milliseconds");
|
||||
|
@ -8961,6 +8966,13 @@ fn parse_trailing_comma() {
|
|||
ParserError::ParserError("Expected an expression, found: from".to_string())
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
trailing_commas
|
||||
.parse_sql_statements("REVOKE USAGE, SELECT, ON p TO u")
|
||||
.unwrap_err(),
|
||||
ParserError::ParserError("Expected a privilege keyword, found: ON".to_string())
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
trailing_commas
|
||||
.parse_sql_statements("CREATE TABLE employees (name text, age int,)")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue