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 6d5fbda53f2 Support parsing openGauss GRANT sql (#28448)
6d5fbda53f2 is described below

commit 6d5fbda53f2b2b06817cdae03e17927c459a024f
Author: Akash Pambhar <[email protected]>
AuthorDate: Sun Sep 17 15:03:34 2023 +0530

    Support parsing openGauss GRANT sql (#28448)
    
    Support GRANT USAGE ON 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/sql/supported/dcl/grant-user.xml    | 1 +
 4 files changed, 7 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 8aef4046a70..98991736e70 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
@@ -1933,6 +1933,7 @@ onObjectClause
     | ALL FUNCTIONS IN SCHEMA nameList
     | ALL PROCEDURES IN SCHEMA nameList
     | ALL ROUTINES IN SCHEMA nameList
+    | CLIENT_MASTER_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 6668fcef344..009230a1734 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
@@ -1440,3 +1440,7 @@ SET_MASKLEN
 TRUNC
     : T R U N C
     ;
+
+CLIENT_MASTER_KEY
+    : C L I E N T UL_ M A S T E R 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 399c7b0f2ef..acdfba527e0 100644
--- a/test/it/parser/src/main/resources/case/dcl/grant.xml
+++ b/test/it/parser/src/main/resources/case/dcl/grant.xml
@@ -274,4 +274,5 @@
     <grant sql-case-id="grant_view_server_state_to_sqlserver_login" />
     <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" />
 </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 936e78f23d4..f40116a5744 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
@@ -150,4 +150,5 @@
     <sql-case id="grant_view_server_state_to_sqlserver_login" value="GRANT 
VIEW SERVER STATE TO login1" db-types="SQLServer" />
     <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-cases>

Reply via email to