Skip to content

Commit 06f47ca

Browse files
committed
MySQL: Add support for the PUBLIC privilege
1 parent 0cf85d3 commit 06f47ca

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/ast/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6263,6 +6263,7 @@ pub enum Action {
62636263
Operate,
62646264
OverrideShareRestrictions,
62656265
Ownership,
6266+
Public,
62666267
PurchaseDataExchangeListing,
62676268
Read,
62686269
ReadSession,
@@ -6341,6 +6342,7 @@ impl fmt::Display for Action {
63416342
Action::Operate => f.write_str("OPERATE")?,
63426343
Action::OverrideShareRestrictions => f.write_str("OVERRIDE SHARE RESTRICTIONS")?,
63436344
Action::Ownership => f.write_str("OWNERSHIP")?,
6345+
Action::Public => f.write_str("PUBLIC")?,
63446346
Action::PurchaseDataExchangeListing => f.write_str("PURCHASE DATA EXCHANGE LISTING")?,
63456347
Action::Read => f.write_str("READ")?,
63466348
Action::ReadSession => f.write_str("READ SESSION")?,

src/parser/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16063,6 +16063,8 @@ impl<'a> Parser<'a> {
1606316063
Ok(Action::Ownership)
1606416064
} else if self.parse_keyword(Keyword::DROP) {
1606516065
Ok(Action::Drop)
16066+
} else if self.parse_keyword(Keyword::PUBLIC) {
16067+
Ok(Action::Public)
1606616068
} else {
1606716069
self.expected("a privilege keyword", self.peek_token())?
1606816070
}

tests/sqlparser_common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9705,6 +9705,9 @@ fn parse_grant() {
97059705
verified_stmt("GRANT ROLE role1 TO ROLE role2");
97069706
verified_stmt("GRANT ROLE role1 TO USER user");
97079707
verified_stmt("GRANT CREATE SCHEMA ON DATABASE db1 TO ROLE role1");
9708+
9709+
all_dialects_where(|d| d.supports_user_host_grantee())
9710+
.verified_stmt("GRANT PUBLIC TO 'AAA'@'AAA'");
97089711
}
97099712

97109713
#[test]

0 commit comments

Comments
 (0)