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 cf2ec2384ca Fix oracle encryptionSpecification rule (#28683)
cf2ec2384ca is described below

commit cf2ec2384ca82b49af22f2261e6ba4f178fdc2bf
Author: niu niu <[email protected]>
AuthorDate: Mon Oct 9 19:19:58 2023 +0800

    Fix oracle encryptionSpecification rule (#28683)
---
 .../oracle/src/main/antlr4/imports/oracle/DDLStatement.g4        | 2 +-
 test/it/parser/src/main/resources/case/ddl/alter-table.xml       | 9 +++++++++
 .../parser/src/main/resources/sql/supported/ddl/alter-table.xml  | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git 
a/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4 
b/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
index 4735550c0d1..beeacb52cb4 100644
--- a/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
+++ b/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
@@ -324,7 +324,7 @@ identityOption
     ;
 
 encryptionSpecification
-    : (USING STRING_)? (IDENTIFIED BY STRING_)? (integrityAlgorithm? (NO? 
SALT)? | (NO? SALT)? integrityAlgorithm?)
+    : (USING STRING_)? (IDENTIFIED BY (STRING_ | IDENTIFIER_))? 
(integrityAlgorithm? (NO? SALT)? | (NO? SALT)? integrityAlgorithm?)
     ;
 
 inlineConstraint
diff --git a/test/it/parser/src/main/resources/case/ddl/alter-table.xml 
b/test/it/parser/src/main/resources/case/ddl/alter-table.xml
index ebd5c1114b8..1aa090ba25a 100644
--- a/test/it/parser/src/main/resources/case/ddl/alter-table.xml
+++ b/test/it/parser/src/main/resources/case/ddl/alter-table.xml
@@ -1709,4 +1709,13 @@
     <alter-table sql-case-id="alter_table_move_compress_for_oltp">
         <table name="table_name" start-index="12" stop-index="21" />
     </alter-table>
+    
+    <alter-table 
sql-case-id="alter_table_modify_encrypt_identified_by_password">
+        <table name="t1" start-index="12" stop-index="13" />
+        <modify-column>
+            <column-definition type="CLOB" start-index="24" stop-index="55">
+                <column name="a" />
+            </column-definition>
+        </modify-column>
+    </alter-table>
 </sql-parser-test-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml 
b/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
index 41974ac1252..86c9fc1d786 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
@@ -231,4 +231,5 @@
     <sql-case id="alter_table_modify_lob1" value="ALTER TABLE t1 MODIFY LOB(a) 
(KEEP_DUPLICATES)" db-types="Oracle" />
     <sql-case id="alter_table_modify_lob2" value="ALTER TABLE t1 MODIFY LOB(a) 
(COMPRESS LOW)" db-types="Oracle" />
     <sql-case id="alter_table_move_compress_for_oltp" value="ALTER TABLE 
table_name MOVE COMPRESS FOR OLTP" db-types="Oracle" />
+    <sql-case id="alter_table_modify_encrypt_identified_by_password" 
value="ALTER TABLE t1 MODIFY ( a CLOB ENCRYPT IDENTIFIED BY foo)" 
db-types="Oracle" />
 </sql-cases>

Reply via email to