You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2023/10/04 13:51:53 UTC
[shardingsphere] branch master updated: Add oracle alter table modifylobStorageClause parse rule (#28628)
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 f3dec3c80ad Add oracle alter table modifylobStorageClause parse rule (#28628)
f3dec3c80ad is described below
commit f3dec3c80ad7e6d59b66b2e149ff2746fe5fbfca
Author: niu niu <zi...@aliyun.com>
AuthorDate: Wed Oct 4 21:51:46 2023 +0800
Add oracle alter table modifylobStorageClause parse rule (#28628)
---
.../src/main/antlr4/imports/oracle/DDLStatement.g4 | 2 +-
.../src/main/resources/case/ddl/alter-table.xml | 27 ++++++++++------------
.../resources/sql/supported/ddl/alter-table.xml | 3 +++
3 files changed, 16 insertions(+), 16 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 ae5907cbe82..1cce32a7c6a 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
@@ -468,7 +468,7 @@ dropSynonym
;
columnClauses
- : operateColumnClause+ | renameColumnClause | modifyCollectionRetrieval
+ : operateColumnClause+ | renameColumnClause | modifyCollectionRetrieval | modifylobStorageClause
;
operateColumnClause
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 bdad8c54252..ebd5c1114b8 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
@@ -55,11 +55,6 @@
<alter-table sql-case-id="alter_table_modify_lob_shrink_space">
<table name="employees" start-index="12" stop-index="20" />
- <modify-column>
- <column-definition start-index="29" stop-index="31">
- <column name="LOB" />
- </column-definition>
- </modify-column>
</alter-table>
<alter-table sql-case-id="alter_table_set_unused">
@@ -72,11 +67,6 @@
<alter-table sql-case-id="alter_table_modify_lob_cache">
<table name="employees" start-index="12" stop-index="20" />
- <modify-column>
- <column-definition start-index="29" stop-index="31">
- <column name="LOB" />
- </column-definition>
- </modify-column>
</alter-table>
<alter-table sql-case-id="alter_table_move_storage_tablespace">
@@ -1600,11 +1590,6 @@
<alter-table sql-case-id="alter_table_modify_lob_nocache">
<table name="employees" start-index="12" stop-index="20" />
- <modify-column>
- <column-definition start-index="29" stop-index="31">
- <column name="LOB" />
- </column-definition>
- </modify-column>
</alter-table>
<alter-table sql-case-id="alter_table_move_tablespace1">
@@ -1712,4 +1697,16 @@
</column-definition>
</add-column>
</alter-table>
+
+ <alter-table sql-case-id="alter_table_modify_lob1">
+ <table name="t1" start-index="12" stop-index="13" />
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_modify_lob2">
+ <table name="t1" start-index="12" stop-index="13" />
+ </alter-table>
+
+ <alter-table sql-case-id="alter_table_move_compress_for_oltp">
+ <table name="table_name" start-index="12" stop-index="21" />
+ </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 b690d25a6a8..41974ac1252 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
@@ -228,4 +228,7 @@
<sql-case id="alter_table_add_ref_with_rowid" value="ALTER TABLE staff ADD (REF(dept) WITH ROWID)" db-types="Oracle" />
<sql-case id="alter_table_add_scope_for_is" value="ALTER TABLE staff ADD (SCOPE FOR (dept) IS offices)" db-types="Oracle" />
<sql-case id="alter_table_add_column_no_parentheses" value="ALTER TABLE T_MASK ADD new_column VARCHAR2(100)" db-types="Oracle" />
+ <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-cases>