Skip to content

Commit

Permalink
Add support for GRANT, REVOKE openGauss (#28455)
Browse files Browse the repository at this point in the history
Add openGauss SQL support for GRANT and REVOKE for COLUMN_ENCRYPTION_KEY, REVOKE for CLIENT_MASTER_KEY
  • Loading branch information
akashpambhar authored Sep 18, 2023
1 parent db4c229 commit 9b4939b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,7 @@ onObjectClause
| ALL PROCEDURES IN SCHEMA nameList
| ALL ROUTINES IN SCHEMA nameList
| CLIENT_MASTER_KEY nameList
| COLUMN_ENCRYPTION_KEY nameList
;

numericOnlyList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1444,3 +1444,7 @@ TRUNC
CLIENT_MASTER_KEY
: C L I E N T UL_ M A S T E R UL_ K E Y
;

COLUMN_ENCRYPTION_KEY
: C O L U M N UL_ E N C R Y P T I O N UL_ K E Y
;
1 change: 1 addition & 0 deletions test/it/parser/src/main/resources/case/dcl/grant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,5 @@
<grant sql-case-id="grant_view_definition_on_type" />
<grant sql-case-id="grant_execute_on_xml_schema_collection" />
<grant sql-case-id="grant_usage_on_client_master_key" />
<grant sql-case-id="grant_usage_on_column_encryption_key" />
</sql-parser-test-cases>
2 changes: 2 additions & 0 deletions test/it/parser/src/main/resources/case/dcl/revoke.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,6 @@
<revoke sql-case-id="revoke_execute_on_system_object" />
<revoke sql-case-id="revoke_view_definition_on_type" />
<revoke sql-case-id="revoke_execute_on_xml_schema_collection" />
<revoke sql-case-id="revoke_usage_on_column_encryption_key" />
<revoke sql-case-id="revoke_usage_on_client_master_key" />
</sql-parser-test-cases>
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,5 @@
<sql-case id="grant_view_definition_on_type" value="GRANT VIEW DEFINITION ON TYPE::schema1.type1 TO user1 WITH GRANT OPTION" db-types="SQLServer" />
<sql-case id="grant_execute_on_xml_schema_collection" value="GRANT EXECUTE ON XML SCHEMA COLLECTION::schema1.collection1 TO user1" db-types="SQLServer" />
<sql-case id="grant_usage_on_client_master_key" value="GRANT USAGE ON CLIENT_MASTER_KEY MyCMK1 to user1" db-types="openGauss" />
<sql-case id="grant_usage_on_column_encryption_key" value="GRANT USAGE ON COLUMN_ENCRYPTION_KEY MyCEK1 to user1" db-types="openGauss" />
</sql-cases>
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,6 @@
<sql-case id="revoke_execute_on_system_object" value="REVOKE EXECUTE ON sys.sp_addlinkedserver FROM public" db-types="SQLServer" />
<sql-case id="revoke_view_definition_on_type" value="REVOKE VIEW DEFINITION ON TYPE::schema1.type1 FROM user1 CASCADE" db-types="SQLServer" />
<sql-case id="revoke_execute_on_xml_schema_collection" value="REVOKE EXECUTE ON XML SCHEMA COLLECTION::schema1.xmlschemacollection1 FROM user1" db-types="SQLServer" />
<sql-case id="revoke_usage_on_column_encryption_key" value="REVOKE USAGE ON COLUMN_ENCRYPTION_KEY MyCEK1 FROM user1" db-types="openGauss" />
<sql-case id="revoke_usage_on_client_master_key" value="REVOKE USAGE ON CLIENT_MASTER_KEY MyCMK1 FROM user1" db-types="openGauss" />
</sql-cases>

0 comments on commit 9b4939b

Please sign in to comment.