This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 9b4939bbc97 Add support for GRANT, REVOKE openGauss (#28455)
9b4939bbc97 is described below

commit 9b4939bbc9775732e96ff816add6213e2454d1e8
Author: Akash Pambhar <[email protected]>
AuthorDate: Mon Sep 18 11:46:08 2023 +0530

    Add support for GRANT, REVOKE openGauss (#28455)
    
    Add openGauss SQL support for GRANT and REVOKE for COLUMN_ENCRYPTION_KEY, 
REVOKE for CLIENT_MASTER_KEY
---
 .../opengauss/src/main/antlr4/imports/opengauss/DDLStatement.g4       | 1 +
 .../opengauss/src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4   | 4 ++++
 test/it/parser/src/main/resources/case/dcl/grant.xml                  | 1 +
 test/it/parser/src/main/resources/case/dcl/revoke.xml                 | 2 ++
 test/it/parser/src/main/resources/sql/supported/dcl/grant-user.xml    | 1 +
 test/it/parser/src/main/resources/sql/supported/dcl/revoke-user.xml   | 2 ++
 6 files changed, 11 insertions(+)

diff --git 
a/parser/sql/dialect/opengauss/src/main/antlr4/imports/opengauss/DDLStatement.g4
 
b/parser/sql/dialect/opengauss/src/main/antlr4/imports/opengauss/DDLStatement.g4
index 98991736e70..6bc716b689a 100644
--- 
a/parser/sql/dialect/opengauss/src/main/antlr4/imports/opengauss/DDLStatement.g4
+++ 
b/parser/sql/dialect/opengauss/src/main/antlr4/imports/opengauss/DDLStatement.g4
@@ -1934,6 +1934,7 @@ onObjectClause
     | ALL PROCEDURES IN SCHEMA nameList
     | ALL ROUTINES IN SCHEMA nameList
     | CLIENT_MASTER_KEY nameList
+    | COLUMN_ENCRYPTION_KEY nameList
     ;
     
 numericOnlyList
diff --git 
a/parser/sql/dialect/opengauss/src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4
 
b/parser/sql/dialect/opengauss/src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4
index 009230a1734..bd9e06022eb 100644
--- 
a/parser/sql/dialect/opengauss/src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4
+++ 
b/parser/sql/dialect/opengauss/src/main/antlr4/imports/opengauss/OpenGaussKeyword.g4
@@ -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
+    ;
diff --git a/test/it/parser/src/main/resources/case/dcl/grant.xml 
b/test/it/parser/src/main/resources/case/dcl/grant.xml
index acdfba527e0..aeacaf58586 100644
--- a/test/it/parser/src/main/resources/case/dcl/grant.xml
+++ b/test/it/parser/src/main/resources/case/dcl/grant.xml
@@ -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>
diff --git a/test/it/parser/src/main/resources/case/dcl/revoke.xml 
b/test/it/parser/src/main/resources/case/dcl/revoke.xml
index 2066c459756..a5969a0dc53 100644
--- a/test/it/parser/src/main/resources/case/dcl/revoke.xml
+++ b/test/it/parser/src/main/resources/case/dcl/revoke.xml
@@ -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>
diff --git a/test/it/parser/src/main/resources/sql/supported/dcl/grant-user.xml 
b/test/it/parser/src/main/resources/sql/supported/dcl/grant-user.xml
index f40116a5744..c95279f47ff 100644
--- a/test/it/parser/src/main/resources/sql/supported/dcl/grant-user.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dcl/grant-user.xml
@@ -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>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dcl/revoke-user.xml 
b/test/it/parser/src/main/resources/sql/supported/dcl/revoke-user.xml
index 8ccf8f496aa..4db968095c4 100644
--- a/test/it/parser/src/main/resources/sql/supported/dcl/revoke-user.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dcl/revoke-user.xml
@@ -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>

Reply via email to