Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6587,6 +6587,7 @@ pub enum Action {
role: ObjectName,
},
Delete,
Drop,
EvolveSchema,
Exec {
obj_type: Option<ActionExecuteObjectType>,
Expand Down Expand Up @@ -6656,6 +6657,7 @@ impl fmt::Display for Action {
}
Action::DatabaseRole { role } => write!(f, "DATABASE ROLE {role}")?,
Action::Delete => f.write_str("DELETE")?,
Action::Drop => f.write_str("DROP")?,
Action::EvolveSchema => f.write_str("EVOLVE SCHEMA")?,
Action::Exec { obj_type } => {
f.write_str("EXEC")?;
Expand Down
2 changes: 2 additions & 0 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14265,6 +14265,8 @@ impl<'a> Parser<'a> {
Ok(Action::Usage)
} else if self.parse_keyword(Keyword::OWNERSHIP) {
Ok(Action::Ownership)
} else if self.parse_keyword(Keyword::DROP) {
Ok(Action::Drop)
} else {
self.expected("a privilege keyword", self.peek_token())?
}
Expand Down
3 changes: 2 additions & 1 deletion tests/sqlparser_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9317,7 +9317,7 @@ fn parse_drop_role() {

#[test]
fn parse_grant() {
let sql = "GRANT SELECT, INSERT, UPDATE (shape, size), USAGE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CONNECT, CREATE, EXECUTE, TEMPORARY ON abc, def TO xyz, m WITH GRANT OPTION GRANTED BY jj";
let sql = "GRANT SELECT, INSERT, UPDATE (shape, size), USAGE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CONNECT, CREATE, EXECUTE, TEMPORARY, DROP ON abc, def TO xyz, m WITH GRANT OPTION GRANTED BY jj";
match verified_stmt(sql) {
Statement::Grant {
privileges,
Expand Down Expand Up @@ -9355,6 +9355,7 @@ fn parse_grant() {
Action::Create { obj_type: None },
Action::Execute { obj_type: None },
Action::Temporary,
Action::Drop,
],
actions
);
Expand Down
Loading