diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-30 04:54:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-30 04:54:49 +0000 |
commit | 3baf961bf84d7a67c838d6bc09cc5f0fe90a35b4 (patch) | |
tree | dc974c69ee45867df73e46342261aa658eb50392 /tests/dialects/test_oracle.py | |
parent | Releasing debian version 25.21.3-1. (diff) | |
download | sqlglot-3baf961bf84d7a67c838d6bc09cc5f0fe90a35b4.tar.xz sqlglot-3baf961bf84d7a67c838d6bc09cc5f0fe90a35b4.zip |
Merging upstream version 25.24.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_oracle.py')
-rw-r--r-- | tests/dialects/test_oracle.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/dialects/test_oracle.py b/tests/dialects/test_oracle.py index 28a8da9..8675086 100644 --- a/tests/dialects/test_oracle.py +++ b/tests/dialects/test_oracle.py @@ -546,3 +546,21 @@ WHERE self.validate_identity( f"SELECT * FROM t WHERE JSON_EXISTS(name{format_json}, '$[1].middle'{passing}{on_cond})" ) + + def test_grant(self): + grant_cmds = [ + "GRANT purchases_reader_role TO george, maria", + "GRANT USAGE ON TYPE price TO finance_role", + "GRANT USAGE ON DERBY AGGREGATE types.maxPrice TO sales_role", + ] + + for sql in grant_cmds: + with self.subTest(f"Testing Oracles's GRANT command statement: {sql}"): + self.validate_identity(sql, check_command_warning=True) + + self.validate_identity("GRANT SELECT ON TABLE t TO maria, harry") + self.validate_identity("GRANT SELECT ON TABLE s.v TO PUBLIC") + self.validate_identity("GRANT SELECT ON TABLE t TO purchases_reader_role") + self.validate_identity("GRANT UPDATE, TRIGGER ON TABLE t TO anita, zhi") + self.validate_identity("GRANT EXECUTE ON PROCEDURE p TO george") + self.validate_identity("GRANT USAGE ON SEQUENCE order_id TO sales_role") |