mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-14 09:55:01 +00:00
Snowflake: Support IDENTIFIER for GRANT ROLE (#1957)
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
This commit is contained in:
parent
f49c30feb6
commit
7558d35c84
4 changed files with 7 additions and 2 deletions
|
@ -6654,7 +6654,7 @@ pub enum Action {
|
||||||
Replicate,
|
Replicate,
|
||||||
ResolveAll,
|
ResolveAll,
|
||||||
Role {
|
Role {
|
||||||
role: Ident,
|
role: ObjectName,
|
||||||
},
|
},
|
||||||
Select {
|
Select {
|
||||||
columns: Option<Vec<Ident>>,
|
columns: Option<Vec<Ident>>,
|
||||||
|
|
|
@ -14357,7 +14357,7 @@ impl<'a> Parser<'a> {
|
||||||
} else if self.parse_keyword(Keyword::REPLICATE) {
|
} else if self.parse_keyword(Keyword::REPLICATE) {
|
||||||
Ok(Action::Replicate)
|
Ok(Action::Replicate)
|
||||||
} else if self.parse_keyword(Keyword::ROLE) {
|
} else if self.parse_keyword(Keyword::ROLE) {
|
||||||
let role = self.parse_identifier()?;
|
let role = self.parse_object_name(false)?;
|
||||||
Ok(Action::Role { role })
|
Ok(Action::Role { role })
|
||||||
} else if self.parse_keyword(Keyword::SELECT) {
|
} else if self.parse_keyword(Keyword::SELECT) {
|
||||||
Ok(Action::Select {
|
Ok(Action::Select {
|
||||||
|
|
|
@ -9549,6 +9549,8 @@ fn parse_grant() {
|
||||||
verified_stmt("GRANT SELECT ON FUTURE SEQUENCES IN SCHEMA db1.sc1 TO ROLE role1");
|
verified_stmt("GRANT SELECT ON FUTURE SEQUENCES IN SCHEMA db1.sc1 TO ROLE role1");
|
||||||
verified_stmt("GRANT USAGE ON PROCEDURE db1.sc1.foo(INT) TO ROLE role1");
|
verified_stmt("GRANT USAGE ON PROCEDURE db1.sc1.foo(INT) TO ROLE role1");
|
||||||
verified_stmt("GRANT USAGE ON FUNCTION db1.sc1.foo(INT) TO ROLE role1");
|
verified_stmt("GRANT USAGE ON FUNCTION db1.sc1.foo(INT) TO ROLE role1");
|
||||||
|
verified_stmt("GRANT ROLE role1 TO ROLE role2");
|
||||||
|
verified_stmt("GRANT ROLE role1 TO USER user");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -4500,4 +4500,7 @@ fn test_snowflake_identifier_function() {
|
||||||
.is_err(),
|
.is_err(),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
snowflake().verified_stmt("GRANT ROLE IDENTIFIER('AAA') TO USER IDENTIFIER('AAA')");
|
||||||
|
snowflake().verified_stmt("REVOKE ROLE IDENTIFIER('AAA') FROM USER IDENTIFIER('AAA')");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue