File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -13024,14 +13024,18 @@ impl<'a> Parser<'a> {
13024
13024
GranteesType::Share
13025
13025
} else if self.parse_keyword(Keyword::GROUP) {
13026
13026
GranteesType::Group
13027
- } else if self.parse_keyword(Keyword::PUBLIC) {
13028
- GranteesType::Public
13029
13027
} else if self.parse_keywords(&[Keyword::DATABASE, Keyword::ROLE]) {
13030
13028
GranteesType::DatabaseRole
13031
13029
} else if self.parse_keywords(&[Keyword::APPLICATION, Keyword::ROLE]) {
13032
13030
GranteesType::ApplicationRole
13033
13031
} else if self.parse_keyword(Keyword::APPLICATION) {
13034
13032
GranteesType::Application
13033
+ } else if self.peek_keyword(Keyword::PUBLIC) {
13034
+ if dialect_of!(self is MsSqlDialect) {
13035
+ grantee_type
13036
+ } else {
13037
+ GranteesType::Public
13038
+ }
13035
13039
} else {
13036
13040
grantee_type // keep from previous iteraton, if not specified
13037
13041
};
Original file line number Diff line number Diff line change @@ -2160,3 +2160,13 @@ fn parse_print() {
2160
2160
let _ = ms ( ) . verified_stmt ( "PRINT N'Hello, ⛄️!'" ) ;
2161
2161
let _ = ms ( ) . verified_stmt ( "PRINT @my_variable" ) ;
2162
2162
}
2163
+
2164
+ #[ test]
2165
+ fn parse_mssql_grant ( ) {
2166
+ ms ( ) . verified_stmt ( "GRANT SELECT ON my_table TO public, db_admin" ) ;
2167
+ }
2168
+
2169
+ #[ test]
2170
+ fn parse_mssql_deny ( ) {
2171
+ ms ( ) . verified_stmt ( "DENY SELECT ON my_table TO public, db_admin" ) ;
2172
+ }
You can’t perform that action at this time.
0 commit comments