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

zhangliang 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 05c1869ca26 Refactor g4 of shardingsphere-encrypt-distsql-parser 
(#36083)
05c1869ca26 is described below

commit 05c1869ca2699b5404d9aed85d291fa03bf553c9
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Jul 27 23:55:35 2025 +0800

    Refactor g4 of shardingsphere-encrypt-distsql-parser (#36083)
---
 .../parser/src/main/antlr4/imports/encrypt/BaseRule.g4       | 12 ++++++++++--
 .../parser/src/main/antlr4/imports/encrypt/RDLStatement.g4   | 11 -----------
 .../parser/src/main/antlr4/imports/encrypt/RQLStatement.g4   |  4 ++++
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git 
a/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/BaseRule.g4 
b/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/BaseRule.g4
index ec8ece8eb8b..fab84512b62 100644
--- 
a/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/BaseRule.g4
+++ 
b/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/BaseRule.g4
@@ -64,6 +64,14 @@ tableName
     : IDENTIFIER_
     ;
 
-tableRule
-    : RULE tableName
+columnName
+    : IDENTIFIER_
+    ;
+
+ifExists
+    : IF EXISTS
+    ;
+
+ifNotExists
+    : IF NOT EXISTS
     ;
diff --git 
a/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/RDLStatement.g4
 
b/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/RDLStatement.g4
index 41fee7b83f0..56ada08b5db 100644
--- 
a/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/RDLStatement.g4
+++ 
b/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/RDLStatement.g4
@@ -47,10 +47,6 @@ columnDefinition
     : NAME EQ_ columnName
     ;
 
-columnName
-    : IDENTIFIER_
-    ;
-
 cipherColumnDefinition
     :  CIPHER EQ_ cipherColumnName
     ;
@@ -87,10 +83,3 @@ likeQueryAlgorithm
     : LIKE_QUERY_ALGORITHM LP_ algorithmDefinition RP_
     ;
 
-ifExists
-    : IF EXISTS
-    ;
-
-ifNotExists
-    : IF NOT EXISTS
-    ;
diff --git 
a/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/RQLStatement.g4
 
b/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/RQLStatement.g4
index 0ac8f5aa947..277aa6d7267 100644
--- 
a/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/RQLStatement.g4
+++ 
b/features/encrypt/distsql/parser/src/main/antlr4/imports/encrypt/RQLStatement.g4
@@ -23,6 +23,10 @@ showEncryptRules
     : SHOW ENCRYPT (TABLE? tableRule | RULES) (FROM databaseName)?
     ;
 
+tableRule
+    : RULE tableName
+    ;
+
 countEncryptRule
     : COUNT ENCRYPT RULE (FROM databaseName)?
     ;

Reply via email to