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

panjuan 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 f7c33dd  feat: add grammar for drop index. (#9384)
f7c33dd is described below

commit f7c33dda4aa9425f5d1ac35326301395d5059519
Author: coco <[email protected]>
AuthorDate: Tue Feb 9 15:14:58 2021 +0800

    feat: add grammar for drop index. (#9384)
---
 .../src/main/antlr4/imports/oracle/DDLStatement.g4                   | 2 +-
 .../src/main/antlr4/imports/oracle/OracleKeyword.g4                  | 4 ++++
 .../src/main/resources/case/ddl/drop-index.xml                       | 5 +++++
 .../src/main/resources/sql/supported/ddl/drop.xml                    | 1 +
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
index 455408c..7616819 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
@@ -40,7 +40,7 @@ dropTable
     ;
  
 dropIndex
-    : DROP INDEX indexName
+    : DROP INDEX indexName ONLINE? FORCE? ((DEFERRED|IMMEDIATE) INVALIDATION)?
     ;
 
 truncateTable
diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
index d36dd1d..8927a94 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
@@ -906,3 +906,7 @@ REUSE
 STORAGE
     : S T O R A G E
     ;
+
+ONLINE
+    : O N L I N E
+    ;
diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/ddl/drop-index.xml
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/ddl/drop-index.xml
index f9ff47c..cc59cdf 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/ddl/drop-index.xml
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/ddl/drop-index.xml
@@ -52,4 +52,9 @@
     <drop-index sql-case-id="drop_index_if_exists_on_table">
         <table name="t_order" start-index="36" stop-index="42" />
     </drop-index>
+    
+    <drop-index sql-case-id="drop_index_with_online_force_invalidation">
+        <index name="order_index" start-index="11" stop-index="21" />
+    </drop-index>
+    
 </sql-parser-test-cases>
diff --git 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop.xml
 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop.xml
index 4d95b15..edec530 100644
--- 
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop.xml
+++ 
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop.xml
@@ -57,4 +57,5 @@
     <sql-case id="drop_index_concurrently" value="DROP INDEX CONCURRENTLY 
order_index" db-types="PostgreSQL" />
     <sql-case id="drop_index_with_bracket" value="DROP INDEX [order_index] ON 
[t_order]" db-types="SQLServer" />
     <sql-case id="drop_index_if_exists_on_table" value="DROP INDEX IF EXISTS 
order_index ON t_order" db-types="SQLServer" />
+    <sql-case id="drop_index_with_online_force_invalidation" value="DROP INDEX 
order_index ONLINE FORCE DEFERRED INVALIDATION" db-types="Oracle" />
 </sql-cases>

Reply via email to