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

niuzihao 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 2e7a735fe6c Unable to parse this statement that create a database in 
Oracle 29289 (#29583)
2e7a735fe6c is described below

commit 2e7a735fe6c178ec029842611cd70483d1d8965c
Author: ilyas ahsan <[email protected]>
AuthorDate: Thu Dec 28 17:37:13 2023 +0700

    Unable to parse this statement that create a database in Oracle 29289 
(#29583)
---
 .../src/main/antlr4/imports/oracle/DDLStatement.g4       |  5 +++--
 .../parser/src/main/resources/case/ddl/create-table.xml  | 15 +++++++++++++++
 .../main/resources/sql/supported/ddl/create-table.xml    | 16 ++++++++++++++++
 3 files changed, 34 insertions(+), 2 deletions(-)

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 42663662277..9d37130d403 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
@@ -350,7 +350,7 @@ exceptionsClause
     ;
 
 usingIndexClause
-    : USING INDEX (indexName | createIndexClause)?
+    : USING INDEX (indexName | createIndexClause | indexAttributes)?
     ;
 
 createIndexClause
@@ -904,11 +904,12 @@ deferredSegmentCreation
 segmentAttributesClause
     : ( physicalAttributesClause
     | (TABLESPACE tablespaceName | TABLESPACE SET tablespaceSetName)
+    | tableCompression
     | loggingClause)+
     ;
 
 physicalAttributesClause
-    : (PCTFREE INTEGER_ | PCTUSED INTEGER_ | INITRANS INTEGER_ | 
storageClause)+
+    : (PCTFREE INTEGER_ | PCTUSED INTEGER_ | INITRANS INTEGER_ | MAXTRANS 
INTEGER_ | COMPUTE STATISTICS | storageClause)+
     ;
 
 loggingClause
diff --git a/test/it/parser/src/main/resources/case/ddl/create-table.xml 
b/test/it/parser/src/main/resources/case/ddl/create-table.xml
index d068e74876b..ec12d757a20 100644
--- a/test/it/parser/src/main/resources/case/ddl/create-table.xml
+++ b/test/it/parser/src/main/resources/case/ddl/create-table.xml
@@ -2322,4 +2322,19 @@
             <column name="status" />
         </column-definition>
     </create-table>
+
+    <create-table 
sql-case-id="create_table_with_relational_and_physical_properties">
+        <table name="TEST_BASIC2" start-delimiter="&quot;" 
end-delimiter="&quot;" start-index="13" stop-index="36">
+            <owner name="C##TPCC2" start-delimiter="&quot;" 
end-delimiter="&quot;" start-index="13" stop-index="22" />
+        </table>
+        <column-definition type="NUMBER" start-index="43" stop-index="59">
+            <column name="BS_COL01"/>
+        </column-definition>
+        <column-definition type="NUMBER" start-index="66" stop-index="82">
+            <column name="BS_COL02"/>
+        </column-definition>
+        <constraint-definition start-index="89" stop-index="406">
+            <primary-key-column name="BS_COL01" start-delimiter="&quot;" 
end-delimiter="&quot;" start-index="102" stop-index="111" />
+        </constraint-definition>
+    </create-table>
 </sql-parser-test-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/ddl/create-table.xml 
b/test/it/parser/src/main/resources/sql/supported/ddl/create-table.xml
index 7044f6eddee..2bd6a923bd1 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/create-table.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/create-table.xml
@@ -299,4 +299,20 @@
     PARTITION p2 VALUES LESS THAN (2500),
     PARTITION p3 VALUES LESS THAN (MAXVALUE))" db-types="Oracle" />
     <sql-case id="create_table_with_queue" value="CREATE TABLE t_log(id int 
PRIMARY KEY, status varchar(10)) USAGE QUEUE" db-types="Oracle" />
+    <sql-case id="create_table_with_relational_and_physical_properties" 
value="CREATE TABLE &quot;C##TPCC2&quot;.&quot;TEST_BASIC2&quot;
+    (&quot;BS_COL01&quot; NUMBER,
+    &quot;BS_COL02&quot; NUMBER,
+    PRIMARY KEY (&quot;BS_COL01&quot;)
+    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
+    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
+    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
+    BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
+    TABLESPACE &quot;TPCCTAB&quot; ENABLE
+    ) SEGMENT CREATION IMMEDIATE
+    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
+    NOCOMPRESS LOGGING
+    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
+    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
+    BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
+    TABLESPACE &quot;TPCCTAB&quot;" db-types="Oracle" />
 </sql-cases>

Reply via email to