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

chengzhang 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 96021f29aee Add rules for oracle create tablespace. (#27556)
96021f29aee is described below

commit 96021f29aee63d78ab1c2f426bdc61bd18e6d0d5
Author: boyjoy1127 <[email protected]>
AuthorDate: Tue Aug 1 11:16:46 2023 +0800

    Add rules for oracle create tablespace. (#27556)
    
    * feat: add rules for create tablespace.
    
    * feat: enhance create tablespace SQL.
    
    * feat: enhance create tablespace SQL.
    
    * feat: enhance create tablespace SQL.
    
    * feat: enhance create tablespace SQL.
    
    * feat: enhance create tablespace SQL.
    
    * feat: enhance create tablespace SQL.
---
 .../dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4 | 8 +++++++-
 test/it/parser/src/main/resources/case/ddl/create-tablespace.xml  | 6 ++++++
 .../src/main/resources/sql/supported/ddl/create-tablespace.xml    | 6 ++++++
 3 files changed, 19 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 5f92026918c..10d0d126a90 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
@@ -521,7 +521,7 @@ addHashIndexPartition
 
 modifyIndexPartition
     : MODIFY PARTITION partitionName
-    ( (deallocateUnusedClause | allocateExtentClause | 
physicalAttributesClause | loggingClause | indexCompression)+ 
+    ( (deallocateUnusedClause | allocateExtentClause | 
physicalAttributesClause | loggingClause | indexCompression)+
     | PARAMETERS LP_ odciParameters RP_
     | COALESCE (CLEANUP | ONLY | parallelClause)?
     | UPDATE BLOCK REFERENCES
@@ -3614,6 +3614,10 @@ tableCompressionTableSpace
     | NOCOMPRESS
     ;
 
+segmentManagementClause
+    : SEGMENT SPACE MANAGEMENT (AUTO|MANUAL)
+    ;
+
 createTablespace
     : CREATE (BIGFILE|SMALLFILE)? (DATAFILE fileSpecifications)? 
permanentTablespaceClause
     ;
@@ -3627,6 +3631,8 @@ permanentTablespaceClause
     | ENCRYPTION tablespaceEncryptionSpec
     | DEFAULT tableCompressionTableSpace? storageClause?
     | (ONLINE|OFFLINE)
+    | extentManagementClause
+    | segmentManagementClause
     )
     ;
 
diff --git a/test/it/parser/src/main/resources/case/ddl/create-tablespace.xml 
b/test/it/parser/src/main/resources/case/ddl/create-tablespace.xml
index 166299e8deb..0230fc8bc12 100644
--- a/test/it/parser/src/main/resources/case/ddl/create-tablespace.xml
+++ b/test/it/parser/src/main/resources/case/ddl/create-tablespace.xml
@@ -72,4 +72,10 @@
     <create-tablespace 
sql-case-id="create_tablespace_with_storage_flashcache_none" />
     <create-tablespace 
sql-case-id="create_tablespace_with_storage_flashcache_default" />
     <create-tablespace sql-case-id="create_tablespace_with_storage_encrypt" />
+    <create-tablespace sql-case-id="create_tablespace_with_extent_management" 
/>
+    <create-tablespace 
sql-case-id="create_tablespace_with_extent_management_autoallocate" />
+    <create-tablespace 
sql-case-id="create_tablespace_with_extent_management_uniform_size" />
+    <create-tablespace 
sql-case-id="create_tablespace_with_extent_management_uniform" />
+    <create-tablespace sql-case-id="create_tablespace_with_segment_auto" />
+    <create-tablespace sql-case-id="create_tablespace_with_segment_manual" />
 </sql-parser-test-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/ddl/create-tablespace.xml 
b/test/it/parser/src/main/resources/sql/supported/ddl/create-tablespace.xml
index b8d710b291d..485cd2d00d1 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/create-tablespace.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/create-tablespace.xml
@@ -81,4 +81,10 @@
     <sql-case id="create_tablespace_with_storage_flashcache_none" 
value="CREATE TABLESPACE test_space DEFAULT STORAGE (FLASH_CACHE NONE)" 
db-types="Oracle" />
     <sql-case id="create_tablespace_with_storage_flashcache_default" 
value="CREATE TABLESPACE test_space DEFAULT STORAGE (FLASH_CACHE DEFAULT)" 
db-types="Oracle" />
     <sql-case id="create_tablespace_with_storage_encrypt" value="CREATE 
TABLESPACE test_space DEFAULT STORAGE (ENCRYPT)" db-types="Oracle" />
+    <sql-case id="create_tablespace_with_extent_management" value="CREATE 
TABLESPACE test_space EXTENT MANAGEMENT LOCAL" db-types="Oracle" />
+    <sql-case id="create_tablespace_with_extent_management_autoallocate" 
value="CREATE TABLESPACE test_space EXTENT MANAGEMENT LOCAL AUTOALLOCATE" 
db-types="Oracle" />
+    <sql-case id="create_tablespace_with_extent_management_uniform_size" 
value="CREATE TABLESPACE test_space EXTENT MANAGEMENT LOCAL UNIFORM SIZE 5K" 
db-types="Oracle" />
+    <sql-case id="create_tablespace_with_extent_management_uniform" 
value="CREATE TABLESPACE test_space EXTENT MANAGEMENT LOCAL UNIFORM" 
db-types="Oracle" />
+    <sql-case id="create_tablespace_with_segment_auto" value="CREATE 
TABLESPACE test_space SEGMENT SPACE MANAGEMENT AUTO" db-types="Oracle" />
+    <sql-case id="create_tablespace_with_segment_manual" value="CREATE 
TABLESPACE test_space SEGMENT SPACE MANAGEMENT MANUAL" db-types="Oracle" />
 </sql-cases>

Reply via email to