Skip to content
Open
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 @@ -6263,6 +6263,7 @@ pub enum Action {
Operate,
OverrideShareRestrictions,
Ownership,
Public,
PurchaseDataExchangeListing,
Read,
ReadSession,
Expand Down Expand Up @@ -6341,6 +6342,7 @@ impl fmt::Display for Action {
Action::Operate => f.write_str("OPERATE")?,
Action::OverrideShareRestrictions => f.write_str("OVERRIDE SHARE RESTRICTIONS")?,
Action::Ownership => f.write_str("OWNERSHIP")?,
Action::Public => f.write_str("PUBLIC")?,
Action::PurchaseDataExchangeListing => f.write_str("PURCHASE DATA EXCHANGE LISTING")?,
Action::Read => f.write_str("READ")?,
Action::ReadSession => f.write_str("READ SESSION")?,
Expand Down
2 changes: 2 additions & 0 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16063,6 +16063,8 @@ impl<'a> Parser<'a> {
Ok(Action::Ownership)
} else if self.parse_keyword(Keyword::DROP) {
Ok(Action::Drop)
} else if self.parse_keyword(Keyword::PUBLIC) {
Ok(Action::Public)
} else {
self.expected("a privilege keyword", self.peek_token())?
}
Expand Down
3 changes: 3 additions & 0 deletions tests/sqlparser_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9705,6 +9705,9 @@ fn parse_grant() {
verified_stmt("GRANT ROLE role1 TO ROLE role2");
verified_stmt("GRANT ROLE role1 TO USER user");
verified_stmt("GRANT CREATE SCHEMA ON DATABASE db1 TO ROLE role1");

all_dialects_where(|d| d.supports_user_host_grantee())
.verified_stmt("GRANT PUBLIC TO 'AAA'@'AAA'");
}

#[test]
Expand Down