You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/06/11 03:53:49 UTC
[shardingsphere] branch master updated: Refactor Oracle DDL test
cases (#10752)
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 a76daf1 Refactor Oracle DDL test cases (#10752)
a76daf1 is described below
commit a76daf119e07971f5050749e25f7f70060aa8065
Author: Liangda-w <66...@users.noreply.github.com>
AuthorDate: Fri Jun 11 05:53:09 2021 +0200
Refactor Oracle DDL test cases (#10752)
---
.../resources/sql/supported/ddl/alter-database.xml | 28 +++++
.../resources/sql/supported/ddl/alter-function.xml | 26 +++++
.../resources/sql/supported/ddl/alter-index.xml | 38 +++++++
.../sql/supported/ddl/alter-procedure.xml | 26 +++++
.../resources/sql/supported/ddl/alter-sequence.xml | 21 ++++
.../resources/sql/supported/ddl/alter-session.xml | 27 +++++
.../resources/sql/supported/ddl/alter-synonym.xml | 23 ++++
.../resources/sql/supported/ddl/alter-system.xml | 41 +++++++
.../supported/ddl/{alter.xml => alter-table.xml} | 82 --------------
.../sql/supported/ddl/create-database.xml | 29 +++++
.../sql/supported/ddl/create-function.xml | 37 +++++++
.../resources/sql/supported/ddl/create-index.xml | 48 +++++++++
.../sql/supported/ddl/create-procedure.xml | 26 +++++
.../sql/supported/ddl/create-sequence.xml | 23 ++++
.../supported/ddl/{create.xml => create-table.xml} | 118 ---------------------
.../resources/sql/supported/ddl/create-view.xml | 33 ++++++
.../resources/sql/supported/ddl/drop-database.xml | 22 ++++
.../resources/sql/supported/ddl/drop-function.xml | 23 ++++
.../resources/sql/supported/ddl/drop-index.xml | 35 ++++++
.../resources/sql/supported/ddl/drop-procedure.xml | 21 ++++
.../resources/sql/supported/ddl/drop-sequence.xml | 21 ++++
.../resources/sql/supported/ddl/drop-table.xml | 35 ++++++
.../main/resources/sql/supported/ddl/drop-view.xml | 21 ++++
.../src/main/resources/sql/supported/ddl/drop.xml | 63 -----------
24 files changed, 604 insertions(+), 263 deletions(-)
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-database.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-database.xml
new file mode 100644
index 0000000..2cbf350
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-database.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="alter_database_mount" value="ALTER DATABASE db1 MOUNT" db-types="Oracle" />
+ <sql-case id="alter_database_open" value="ALTER DATABASE db1 OPEN READONLY" db-types="Oracle" />
+ <sql-case id="alter_database_recovery1" value="ALTER DATABASE db1 BEGIN BACKUP" db-types="Oracle" />
+ <sql-case id="alter_database_recovery2" value="ALTER DATABASE db1 END BACKUP" db-types="Oracle" />
+ <sql-case id="alter_database_rename" value="ALTER DATABASE db1 RENAME FILE 'a.dbf' to 'b.dbf'" db-types="Oracle" />
+ <sql-case id="alter_database_create1" value="ALTER DATABASE db1 CREATE DATAFILE '01.dbf' as '01.dbf'" db-types="Oracle" />
+ <sql-case id="alter_database_create2" value="ALTER DATABASE db1 CREATE DATAFILE 2 as '02.dbf'" db-types="Oracle" />
+ <sql-case id="alter_database_create3" value="ALTER DATABASE db1 CREATE DATAFILE '03.dbf' as NEW" db-types="Oracle" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-function.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-function.xml
new file mode 100644
index 0000000..8a49120
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-function.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="alter_function_rename" value="ALTER FUNCTION sqrt(integer) RENAME TO square_root" db-types="PostgreSQL"/>
+ <sql-case id="alter_function_set" value="ALTER FUNCTION check_password(text) SET search_path = admin,pg_temp" db-types="PostgreSQL" />
+ <sql-case id="alter_function_owner" value="ALTER FUNCTION sqrt(integer) OWNER TO joe" db-types="PostgreSQL" />
+ <sql-case id="alter_function_set_schema" value="ALTER FUNCTION sqrt(integer) SET SCHEMA maths" db-types="PostgreSQL" />
+ <sql-case id="alter_function_reset" value="ALTER FUNCTION check_password(text) RESET search_path" db-types="PostgreSQL" />
+ <sql-case id="alter_function_depend_on" value="ALTER FUNCTION sqrt(integer) DEPENDS ON EXTENSION mathlib" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-index.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-index.xml
new file mode 100644
index 0000000..51b0c1c
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-index.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="alter_index" value="ALTER INDEX order_index REBUILD PARALLEL" db-types="Oracle" />
+ <sql-case id="alter_index_with_space" value=" ALTER INDEX
+ order_index
+ REBUILD PARALLEL " db-types="Oracle" />
+ <sql-case id="alter_index_with_quota" value="ALTER INDEX "order_index" REBUILD PARALLEL" db-types="Oracle" />
+ <sql-case id="alter_index_with_parallel" value="ALTER INDEX order_index PARALLEL" db-types="Oracle" />
+ <sql-case id="alter_index_with_compile" value="ALTER INDEX order_index COMPILE" db-types="Oracle" />
+ <sql-case id="alter_index_with_disable" value="ALTER INDEX order_index DISABLE" db-types="Oracle" />
+ <sql-case id="alter_index_with_unusable" value="ALTER INDEX order_index UNUSABLE ONLINE IMMEDIATE INVALIDATION" db-types="Oracle" />
+ <sql-case id="alter_index_with_visable" value="ALTER INDEX order_index VISIBLE" db-types="Oracle" />
+ <sql-case id="alter_index_with_rename" value="ALTER INDEX order_index RENAME TO order_index_new" db-types="Oracle" />
+ <sql-case id="alter_index_with_coalesce" value="ALTER INDEX order_index COALESCE CLEANUP ONLY PARALLEL" db-types="Oracle" />
+ <sql-case id="alter_index_with_usage" value="ALTER INDEX order_index MONITORING USAGE" db-types="Oracle" />
+ <sql-case id="alter_index_with_update" value="ALTER INDEX order_index UPDATE BLOCK REFERENCES" db-types="Oracle" />
+ <sql-case id="alter_index_rebuild" value="ALTER INDEX order_index ON t_order REBUILD" db-types="SQLServer" />
+ <sql-case id="alter_index_with_quota_bracket" value="ALTER INDEX [order_index] ON [t_order] REBUILD" db-types="SQLServer" />
+ <sql-case id="alter_index_set_tablespace" value="ALTER INDEX distributors SET TABLESPACE fasttablespace" db-types="PostgreSQL" />
+ <sql-case id="alter_index_alter_column" value="ALTER INDEX t_order_idx ALTER COLUMN 3 SET STATISTICS 1000" db-types="PostgreSQL"/>
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-procedure.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-procedure.xml
new file mode 100644
index 0000000..f968cab
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-procedure.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="alter_procedure_rename" value="ALTER PROCEDURE insert_data(integer, integer) RENAME TO insert_record" db-types="PostgreSQL" />
+ <sql-case id="alter_procedure_owner" value="ALTER PROCEDURE insert_data(integer, integer) OWNER TO joe" db-types="PostgreSQL" />
+ <sql-case id="alter_procedure_set_schema" value="ALTER PROCEDURE insert_data(integer, integer) SET SCHEMA accounting" db-types="PostgreSQL" />
+ <sql-case id="alter_procedure_depends_on" value="ALTER PROCEDURE insert_data(integer, integer) DEPENDS ON EXTENSION myext" db-types="PostgreSQL" />
+ <sql-case id="alter_procedure_set_param" value="ALTER PROCEDURE check_password(text) SET search_path = admin,pg_temp" db-types="PostgreSQL" />
+ <sql-case id="alter_procedure_reset_param" value="ALTER PROCEDURE check_password(text) RESET search_path" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-sequence.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-sequence.xml
new file mode 100644
index 0000000..b2dc852
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-sequence.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="alter_sequence" value="ALTER SEQUENCE seq_id MINVALUE 10" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-session.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-session.xml
new file mode 100644
index 0000000..bc72cfc
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-session.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="alter_session_enable_parallel_dml" value="ALTER SESSION ENABLE PARALLEL DML" db-types="Oracle" />
+ <sql-case id="alter_session_advise_commit" value="ALTER SESSION ADVISE COMMIT" db-types="Oracle" />
+ <sql-case id="alter_session_advise_rollback" value="ALTER SESSION ADVISE ROLLBACK" db-types="Oracle" />
+ <sql-case id="alter_session_close_database_link" value="ALTER SESSION CLOSE DATABASE LINK private_link" db-types="Oracle" />
+ <sql-case id="alter_session_change_parameter" value="ALTER SESSION SET NLS_DATE_LANGUAGE = French" db-types="Oracle" />
+ <sql-case id="alter_session_set_container" value="ALTER SESSION SET CONTAINER = cdb$root" db-types="Oracle" />
+ <sql-case id="alter_session_set_container_service" value="ALTER SESSION SET CONTAINER = pdb1 SERVICE = my_new_service" db-types="Oracle" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-synonym.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-synonym.xml
new file mode 100644
index 0000000..984dacf
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-synonym.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="alter_synonym_compile" value="ALTER SYNONYM offices COMPILE" db-types="Oracle" />
+ <sql-case id="alter_public_synonym_compile" value="ALTER PUBLIC SYNONYM emp_table COMPILE" db-types="Oracle" />
+ <sql-case id="alter_synonym_noneditionable" value="ALTER SYNONYM offices NONEDITIONABLE" db-types="Oracle" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-system.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-system.xml
new file mode 100644
index 0000000..31e82e8
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-system.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="alter_system_archive_log_change" value="ALTER SYSTEM ARCHIVE LOG CHANGE 9356083" db-types="Oracle" />
+ <sql-case id="alter_system_archive_log_logfile" value="ALTER SYSTEM ARCHIVE LOG LOGFILE 'diskl:log6.log' TO 'diska:[arch$]'" db-types="Oracle" />
+ <sql-case id="alter_system_check_datafiles" value="ALTER SYSTEM CHECK DATAFILES" db-types="Oracle" />
+ <sql-case id="alter_system_quiesce_restricted" value="ALTER SYSTEM QUIESCE RESTRICTED" db-types="Oracle" />
+ <sql-case id="alter_system_start_rolling_migration" value="ALTER SYSTEM START ROLLING MIGRATION TO '11.2.0.0.0'" db-types="Oracle" />
+ <sql-case id="alter_system_start_rolling_patch" value="ALTER SYSTEM START ROLLING PATCH" db-types="Oracle" />
+ <sql-case id="alter_system_enable_affinity_service" value="ALTER SYSTEM ENABLE AFFINITY uwclass.servers SERVICE pdbdev" db-types="Oracle" />
+ <sql-case id="alter_system_shutdown_immediate" value="ALTER SYSTEM SHUTDOWN IMMEDIATE 'D000'" db-types="Oracle" />
+ <sql-case id="alter_system_set_comment_container_scope" value="ALTER SYSTEM SET audit_sys_operations = TRUE COMMENT = 'Begin auditing SYS' CONTAINER = ALL SCOPE = SPFILE" db-types="Oracle" />
+ <sql-case id="alter_system_set_query_rewrite_enabled" value="ALTER SYSTEM SET QUERY_REWRITE_ENABLED = TRUE" db-types="Oracle" />
+ <sql-case id="alter_system_reset_parameter_scope" value="ALTER SYSTEM RESET plsql_code_type SCOPE = SPFILE" db-types="Oracle" />
+ <sql-case id="alter_system_relocate_client" value="ALTER SYSTEM RELOCATE CLIENT '-MGMTDB:_mgmtdb'" db-types="Oracle" />
+ <sql-case id="alter_system_enable_restricted_session" value="ALTER SYSTEM ENABLE RESTRICTED SESSION" db-types="Oracle" />
+ <sql-case id="alter_system_encryption_wallet_open_identified_by_password" value="ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "password"" db-types="Oracle" />
+ <sql-case id="alter_system_encryption_key_identified_by_password" value="ALTER SYSTEM SET ENCRYPTION KEY IDENTIFIED BY "password"" db-types="Oracle" />
+ <sql-case id="alter_system_flush_shared_pool" value="ALTER SYSTEM FLUSH SHARED_POOL" db-types="Oracle" />
+ <sql-case id="alter_system_checkpoint" value="ALTER SYSTEM CHECKPOINT" db-types="Oracle" />
+ <sql-case id="alter_system_set_dispatchers" value="ALTER SYSTEM SET DISPATCHERS = '(INDEX=0)(PROTOCOL=TCP)(DISPATCHERS=5)','(INDEX=1)(PROTOCOL=ipc)(DISPATCHERS=10)'" db-types="Oracle" />
+ <sql-case id="alter_system_switch_logfile" value="ALTER SYSTEM SWITCH LOGFILE" db-types="Oracle" />
+ <sql-case id="alter_system_enable_distributed_recovery" value="ALTER SYSTEM ENABLE DISTRIBUTED RECOVERY" db-types="Oracle" />
+ <sql-case id="alter_system_flush_passwordfile_metada_cache" value="ALTER SYSTEM FLUSH PASSWORDFILE_METADATA_CACHE" db-types="Oracle" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-table.xml
similarity index 68%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter.xml
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-table.xml
index 8c32858..37e649b 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/alter-table.xml
@@ -140,86 +140,4 @@
<sql-case id="alter_table_modify_range_partition" value="ALTER TABLE t_order MODIFY PARTITION hash_partition ADD SUBPARTITION P1 VALUES('COMPLETE');" db-types="Oracle" />
<sql-case id="alter_table_move_partition" value="ALTER TABLE t_order MOVE PARTITION p0 TABLESPACE space0" db-types="Oracle" />
<sql-case id="alter_table_coalesce_partition" value="ALTER TABLE t_order COALESCE PARTITION" db-types="Oracle" />
-<!-- alter index test-->
- <sql-case id="alter_index" value="ALTER INDEX order_index REBUILD PARALLEL" db-types="Oracle" />
- <sql-case id="alter_index_with_space" value=" ALTER INDEX
- order_index
- REBUILD PARALLEL " db-types="Oracle" />
- <sql-case id="alter_index_with_quota" value="ALTER INDEX "order_index" REBUILD PARALLEL" db-types="Oracle" />
- <sql-case id="alter_index_with_parallel" value="ALTER INDEX order_index PARALLEL" db-types="Oracle" />
- <sql-case id="alter_index_with_compile" value="ALTER INDEX order_index COMPILE" db-types="Oracle" />
- <sql-case id="alter_index_with_disable" value="ALTER INDEX order_index DISABLE" db-types="Oracle" />
- <sql-case id="alter_index_with_unusable" value="ALTER INDEX order_index UNUSABLE ONLINE IMMEDIATE INVALIDATION" db-types="Oracle" />
- <sql-case id="alter_index_with_visable" value="ALTER INDEX order_index VISIBLE" db-types="Oracle" />
- <sql-case id="alter_index_with_rename" value="ALTER INDEX order_index RENAME TO order_index_new" db-types="Oracle" />
- <sql-case id="alter_index_with_coalesce" value="ALTER INDEX order_index COALESCE CLEANUP ONLY PARALLEL" db-types="Oracle" />
- <sql-case id="alter_index_with_usage" value="ALTER INDEX order_index MONITORING USAGE" db-types="Oracle" />
- <sql-case id="alter_index_with_update" value="ALTER INDEX order_index UPDATE BLOCK REFERENCES" db-types="Oracle" />
- <sql-case id="alter_index_rebuild" value="ALTER INDEX order_index ON t_order REBUILD" db-types="SQLServer" />
- <sql-case id="alter_index_with_quota_bracket" value="ALTER INDEX [order_index] ON [t_order] REBUILD" db-types="SQLServer" />
- <sql-case id="alter_index_set_tablespace" value="ALTER INDEX distributors SET TABLESPACE fasttablespace" db-types="PostgreSQL" />
- <sql-case id="alter_index_alter_column" value="ALTER INDEX t_order_idx ALTER COLUMN 3 SET STATISTICS 1000" db-types="PostgreSQL"/>
-
-<!-- alter function test-->
- <sql-case id="alter_function_rename" value="ALTER FUNCTION sqrt(integer) RENAME TO square_root" db-types="PostgreSQL"/>
- <sql-case id="alter_function_set" value="ALTER FUNCTION check_password(text) SET search_path = admin,pg_temp" db-types="PostgreSQL" />
- <sql-case id="alter_function_owner" value="ALTER FUNCTION sqrt(integer) OWNER TO joe" db-types="PostgreSQL" />
- <sql-case id="alter_function_set_schema" value="ALTER FUNCTION sqrt(integer) SET SCHEMA maths" db-types="PostgreSQL" />
- <sql-case id="alter_function_reset" value="ALTER FUNCTION check_password(text) RESET search_path" db-types="PostgreSQL" />
- <sql-case id="alter_function_depend_on" value="ALTER FUNCTION sqrt(integer) DEPENDS ON EXTENSION mathlib" db-types="PostgreSQL" />
-<!--alter database test-->
- <sql-case id="alter_database_mount" value="ALTER DATABASE db1 MOUNT" db-types="Oracle" />
- <sql-case id="alter_database_open" value="ALTER DATABASE db1 OPEN READONLY" db-types="Oracle" />
- <sql-case id="alter_database_recovery1" value="ALTER DATABASE db1 BEGIN BACKUP" db-types="Oracle" />
- <sql-case id="alter_database_recovery2" value="ALTER DATABASE db1 END BACKUP" db-types="Oracle" />
- <sql-case id="alter_database_rename" value="ALTER DATABASE db1 RENAME FILE 'a.dbf' to 'b.dbf'" db-types="Oracle" />
- <sql-case id="alter_database_create1" value="ALTER DATABASE db1 CREATE DATAFILE '01.dbf' as '01.dbf'" db-types="Oracle" />
- <sql-case id="alter_database_create2" value="ALTER DATABASE db1 CREATE DATAFILE 2 as '02.dbf'" db-types="Oracle" />
- <sql-case id="alter_database_create3" value="ALTER DATABASE db1 CREATE DATAFILE '03.dbf' as NEW" db-types="Oracle" />
-<!--alter procedure test-->
- <sql-case id="alter_procedure_rename" value="ALTER PROCEDURE insert_data(integer, integer) RENAME TO insert_record" db-types="PostgreSQL" />
- <sql-case id="alter_procedure_owner" value="ALTER PROCEDURE insert_data(integer, integer) OWNER TO joe" db-types="PostgreSQL" />
- <sql-case id="alter_procedure_set_schema" value="ALTER PROCEDURE insert_data(integer, integer) SET SCHEMA accounting" db-types="PostgreSQL" />
- <sql-case id="alter_procedure_depends_on" value="ALTER PROCEDURE insert_data(integer, integer) DEPENDS ON EXTENSION myext" db-types="PostgreSQL" />
- <sql-case id="alter_procedure_set_param" value="ALTER PROCEDURE check_password(text) SET search_path = admin,pg_temp" db-types="PostgreSQL" />
- <sql-case id="alter_procedure_reset_param" value="ALTER PROCEDURE check_password(text) RESET search_path" db-types="PostgreSQL" />
-<!--alter server test-->
-<!-- <sql-case id="alter_server_options" value="ALTER SERVER foo OPTIONS (host 'foo', dbname 'foodb')" db-types="PostgreSQL" />-->
-<!-- <sql-case id="alter_server_version" value="ALTER SERVER foo VERSION '8.4' OPTIONS (SET host 'baz')" db-types="PostgreSQL" />-->
-<!-- alter sequence test-->
- <sql-case id="alter_sequence" value="ALTER SEQUENCE seq_id MINVALUE 10" db-types="PostgreSQL" />
-<!--alter synonym test-->
- <sql-case id="alter_synonym_compile" value="ALTER SYNONYM offices COMPILE" db-types="Oracle" />
- <sql-case id="alter_public_synonym_compile" value="ALTER PUBLIC SYNONYM emp_table COMPILE" db-types="Oracle" />
- <sql-case id="alter_synonym_noneditionable" value="ALTER SYNONYM offices NONEDITIONABLE" db-types="Oracle" />
-<!--alter session test-->
- <sql-case id="alter_session_enable_parallel_dml" value="ALTER SESSION ENABLE PARALLEL DML" db-types="Oracle" />
- <sql-case id="alter_session_advise_commit" value="ALTER SESSION ADVISE COMMIT" db-types="Oracle" />
- <sql-case id="alter_session_advise_rollback" value="ALTER SESSION ADVISE ROLLBACK" db-types="Oracle" />
- <sql-case id="alter_session_close_database_link" value="ALTER SESSION CLOSE DATABASE LINK private_link" db-types="Oracle" />
- <sql-case id="alter_session_change_parameter" value="ALTER SESSION SET NLS_DATE_LANGUAGE = French" db-types="Oracle" />
- <sql-case id="alter_session_set_container" value="ALTER SESSION SET CONTAINER = cdb$root" db-types="Oracle" />
- <sql-case id="alter_session_set_container_service" value="ALTER SESSION SET CONTAINER = pdb1 SERVICE = my_new_service" db-types="Oracle" />
-<!--alter system test-->
- <sql-case id="alter_system_archive_log_change" value="ALTER SYSTEM ARCHIVE LOG CHANGE 9356083" db-types="Oracle" />
- <sql-case id="alter_system_archive_log_logfile" value="ALTER SYSTEM ARCHIVE LOG LOGFILE 'diskl:log6.log' TO 'diska:[arch$]'" db-types="Oracle" />
- <sql-case id="alter_system_check_datafiles" value="ALTER SYSTEM CHECK DATAFILES" db-types="Oracle" />
- <sql-case id="alter_system_quiesce_restricted" value="ALTER SYSTEM QUIESCE RESTRICTED" db-types="Oracle" />
- <sql-case id="alter_system_start_rolling_migration" value="ALTER SYSTEM START ROLLING MIGRATION TO '11.2.0.0.0'" db-types="Oracle" />
- <sql-case id="alter_system_start_rolling_patch" value="ALTER SYSTEM START ROLLING PATCH" db-types="Oracle" />
- <sql-case id="alter_system_enable_affinity_service" value="ALTER SYSTEM ENABLE AFFINITY uwclass.servers SERVICE pdbdev" db-types="Oracle" />
- <sql-case id="alter_system_shutdown_immediate" value="ALTER SYSTEM SHUTDOWN IMMEDIATE 'D000'" db-types="Oracle" />
- <sql-case id="alter_system_set_comment_container_scope" value="ALTER SYSTEM SET audit_sys_operations = TRUE COMMENT = 'Begin auditing SYS' CONTAINER = ALL SCOPE = SPFILE" db-types="Oracle" />
- <sql-case id="alter_system_set_query_rewrite_enabled" value="ALTER SYSTEM SET QUERY_REWRITE_ENABLED = TRUE" db-types="Oracle" />
- <sql-case id="alter_system_reset_parameter_scope" value="ALTER SYSTEM RESET plsql_code_type SCOPE = SPFILE" db-types="Oracle" />
- <sql-case id="alter_system_relocate_client" value="ALTER SYSTEM RELOCATE CLIENT '-MGMTDB:_mgmtdb'" db-types="Oracle" />
- <sql-case id="alter_system_enable_restricted_session" value="ALTER SYSTEM ENABLE RESTRICTED SESSION" db-types="Oracle" />
- <sql-case id="alter_system_encryption_wallet_open_identified_by_password" value="ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "password"" db-types="Oracle" />
- <sql-case id="alter_system_encryption_key_identified_by_password" value="ALTER SYSTEM SET ENCRYPTION KEY IDENTIFIED BY "password"" db-types="Oracle" />
- <sql-case id="alter_system_flush_shared_pool" value="ALTER SYSTEM FLUSH SHARED_POOL" db-types="Oracle" />
- <sql-case id="alter_system_checkpoint" value="ALTER SYSTEM CHECKPOINT" db-types="Oracle" />
- <sql-case id="alter_system_set_dispatchers" value="ALTER SYSTEM SET DISPATCHERS = '(INDEX=0)(PROTOCOL=TCP)(DISPATCHERS=5)','(INDEX=1)(PROTOCOL=ipc)(DISPATCHERS=10)'" db-types="Oracle" />
- <sql-case id="alter_system_switch_logfile" value="ALTER SYSTEM SWITCH LOGFILE" db-types="Oracle" />
- <sql-case id="alter_system_enable_distributed_recovery" value="ALTER SYSTEM ENABLE DISTRIBUTED RECOVERY" db-types="Oracle" />
- <sql-case id="alter_system_flush_passwordfile_metada_cache" value="ALTER SYSTEM FLUSH PASSWORDFILE_METADATA_CACHE" db-types="Oracle" />
</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-database.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-database.xml
new file mode 100644
index 0000000..12672e3
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-database.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="create_database" value="CREATE DATABASE lusiadas" db-types="PostgreSQL" />
+ <sql-case id="create_database_owner" value="CREATE DATABASE sales OWNER salesapp TABLESPACE salesspace" db-types="PostgreSQL" />
+ <sql-case id="create_database_with_location_and_encoding" value="CREATE DATABASE music2
+ LC_COLLATE 'sv_SE.iso885915' LC_CTYPE 'sv_SE.iso885915'
+ ENCODING LATIN9
+ TEMPLATE template0" db-types="PostgreSQL" />
+ <sql-case id="create_database_with_location" value="CREATE DATABASE music
+ LC_COLLATE 'sv_SE.utf8' LC_CTYPE 'sv_SE.utf8'
+ TEMPLATE template0" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-function.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-function.xml
new file mode 100644
index 0000000..6cd2490
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-function.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="create_function" value="CREATE FUNCTION add(integer, integer) RETURNS integer
+ AS 'select $1 + $2;'
+ LANGUAGE SQL
+ IMMUTABLE
+ RETURNS NULL ON NULL INPUT" db-types="PostgreSQL" />
+ <sql-case id="create_function_with_argname" value="CREATE OR REPLACE FUNCTION increment(i integer) RETURNS integer AS
+ $$
+ BEGIN
+ RETURN i + 1;
+ END;
+ $$ LANGUAGE plpgsql" db-types="PostgreSQL" />
+ <sql-case id="create_function_with_multiple_output_parameters" value="CREATE FUNCTION dup(in int, out f1 int, out f2 text)
+ AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
+ LANGUAGE SQL" db-types="PostgreSQL" />
+ <sql-case id="create_function_return_table" value="CREATE FUNCTION dup(int) RETURNS TABLE(f1 int, f2 text)
+ AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
+ LANGUAGE SQL" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-index.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-index.xml
new file mode 100644
index 0000000..510c04f
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-index.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="create_index" value="CREATE INDEX t_log_index ON t_log (id)" db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
+ <sql-case id="create_unique_index" value="CREATE UNIQUE INDEX t_log_index ON t_log (id)" db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
+ <sql-case id="create_composite_index" value="CREATE INDEX order_index ON t_order (order_id, user_id, status)" db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
+ <sql-case id="create_btree_index" value="CREATE INDEX order_index ON t_order USING BTREE (order_id)" db-types="PostgreSQL" />
+ <sql-case id="create_index_with_space" value=" CREATE INDEX
+ order_index
+ ON
+ t_order (order_id) " db-types="MySQL,SQLServer" />
+ <sql-case id="create_index_with_back_quota" value="CREATE INDEX `order_index` ON `t_order` (`order_id`)" db-types="MySQL" />
+ <sql-case id="create_index_with_quota" value="CREATE INDEX "order_index" ON "t_order" ("order_id")" db-types="Oracle" />
+ <sql-case id="create_index_with_function" value="CREATE INDEX idx_upper_status ON t_order (UPPER(status))" db-types="Oracle,PostgreSQL" />
+ <sql-case id="create_index_with_bracket" value="CREATE INDEX [order_index] ON [t_order] ([order_id])" db-types="SQLServer" />
+ <sql-case id="create_index_with_no_default_fill_factor" value="CREATE UNIQUE INDEX order_index ON t_order (order_id) WITH (fillfactor = 70)" db-types="PostgreSQL"/>
+ <sql-case id="create_index_with_tablespace" value="CREATE INDEX code_idx ON t_order (code) TABLESPACE indexspace" db-types="PostgreSQL"/>
+ <sql-case id="create_index_using_gist" value="CREATE INDEX pointloc ON t_order USING gist (func1(location,location))" db-types="PostgreSQL" />
+ <sql-case id="create_index_with_concurrently" value="CREATE INDEX CONCURRENTLY sales_quantity_index ON t_order(quantity)" db-types="PostgreSQL" />
+ <sql-case id="create_index_with_double_quota" value="CREATE INDEX "order_index" ON "t_order" ("order_id")" db-types="PostgreSQL" />
+ <sql-case id="create_index_with_double_quota_and_uescape" value="CREATE INDEX U&"order_index!0061t!+000061" UESCAPE '!' ON u&"t_order" (u&"order_id")" db-types="PostgreSQL" />
+ <sql-case id="create_index_concurrently" value="CREATE INDEX CONCURRENTLY order_index ON t_order (order_id)" db-types="PostgreSQL" />
+ <sql-case id="create_index_if_not_exists" value="CREATE INDEX IF NOT EXISTS order_index ON t_order (order_id)" db-types="PostgreSQL" />
+ <sql-case id="create_index_using_btree" value="CREATE INDEX order_index ON t_order (order_id) USING BTREE" db-types="PostgreSQL" />
+ <sql-case id="create_index_with_unique" value="CREATE UNIQUE INDEX order_index ON t_order (order_id)" db-types="Oracle" />
+ <sql-case id="create_index_with_usable" value="CREATE UNIQUE INDEX order_index ON t_order (order_id) USABLE" db-types="Oracle" />
+ <sql-case id="create_index_with_unusable" value="CREATE UNIQUE INDEX order_index ON t_order (order_id) UNUSABLE" db-types="Oracle" />
+ <sql-case id="create_index_with_immediate_invalidation" value="CREATE UNIQUE INDEX order_index ON t_order (order_id) IMMEDIATE INVALIDATION" db-types="Oracle" />
+ <sql-case id="create_index_with_cluster_index" value="CREATE UNIQUE INDEX order_index ON CLUSTER t_cluster" db-types="Oracle" />
+ <sql-case id="create_index_with_bitmap" value="CREATE BITMAP INDEX order_index ON t_order (order_id)" db-types="Oracle" />
+ <sql-case id="create_gin_index" value="CREATE INDEX gin_idx ON t_order USING GIN (locations) WITH (fastupdate = off)" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-procedure.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-procedure.xml
new file mode 100644
index 0000000..5d78cae
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-procedure.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="create_procedure" value="CREATE PROCEDURE insert_data(a integer, b integer)
+ LANGUAGE SQL
+ AS $$
+ INSERT INTO tbl VALUES (a);
+ INSERT INTO tbl VALUES (b);
+ $$" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-sequence.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-sequence.xml
new file mode 100644
index 0000000..fce27db
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-sequence.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="create_sequence" value="CREATE SEQUENCE seq_id" db-types="PostgreSQL" />
+ <sql-case id="create_sequence_with_option" value="CREATE SEQUENCE TEMPORARY seq_option" db-types="PostgreSQL" />
+ <sql-case id="create_sequence_complex" value="CREATE SEQUENCE seq_complex MINVALUE 0 MAXVALUE 100 START 0" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-table.xml
similarity index 71%
rename from shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create.xml
rename to shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-table.xml
index 5f87bcc..2b82aee 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-table.xml
@@ -36,8 +36,6 @@
<sql-case id="create_object_table" value="CREATE TABLE t_log OF t_log_type" db-types="Oracle" />
<sql-case id="create_local_temp_table" value="CREATE LOCAL TEMP TABLE t_temp_log(id int, status varchar(10))" db-types="PostgreSQL" />
<sql-case id="create_unlogged_table" value="CREATE UNLOGGED TABLE t_log(id int, status varchar(10))" db-types="PostgreSQL" />
- <sql-case id="create_unique_index" value="CREATE UNIQUE INDEX t_log_index ON t_log (id)" db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
-
<sql-case id="create_table_with_space" value=" CREATE TABLE t_order_item (
item_id INT,
order_id INT,
@@ -74,12 +72,6 @@
<sql-case id="create_table_with_out_of_line_btree_index" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), INDEX order_index (order_id) USING BTREE)" db-types="MySQL" />
<sql-case id="create_table_with_comment" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10)) COMMENT 't_order'" db-types="MySQL" />
<sql-case id="create_table_with_partition" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10)) PARTITION BY HASH (order_id) PARTITIONS 2" db-types="MySQL,PostgreSQL" />
- <!--
- <sql-case id="create_table_select" value="CREATE TABLE t_order_bak AS SELECT * FROM t_order" db-types="MySQL" />
- <sql-case id="create_table_like" value="CREATE TABLE t_order_bak (LIKE t_order)" db-types="MySQL" />
- -->
- <sql-case id="create_composite_index" value="CREATE INDEX order_index ON t_order (order_id, user_id, status)" db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
- <sql-case id="create_btree_index" value="CREATE INDEX order_index ON t_order USING BTREE (order_id)" db-types="PostgreSQL" />
<sql-case id="create_table_with_quota" value="CREATE TABLE "t_order" ("order_id" NUMBER(10), "user_id" NUMBER(10), "status" VARCHAR2(10), "column1" VARCHAR2(10), "column2" VARCHAR2(10), "column3" VARCHAR2(10))" db-types="Oracle" />
<sql-case id="create_table_with_column_on_null_default" value="CREATE TABLE t_order (order_id NUMBER(10) DEFAULT ON NULL 0, user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" db-types="Oracle" />
<sql-case id="create_table_with_column_identity" value="CREATE TABLE t_order (order_id NUMBER(10) GENERATED BY DEFAULT AS IDENTITY START WITH 1 MAXVALUE 100, user_id NUMBER(10), status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3 VARCHAR2(10))" db-types="Oracle" />
@@ -99,10 +91,7 @@
<sql-case id="create_table_with_xmltype_table_oracle" value="CREATE TABLE xwarehouses OF XMLTYPE XMLSCHEMA "http://www.example.com/xwarehouses.xsd" ELEMENT "Warehouse" ;" db-types="Oracle" />
<sql-case id="create_table_with_xmltype_column_oracle" value="CREATE TABLE xwarehouses (warehouse_id NUMBER, warehouse_spec XMLTYPE) XMLTYPE warehouse_spec STORE AS CLOB (TABLESPACE example STORAGE (INITIAL 6144) CHUNK 4000 NOCACHE LOGGING);" db-types="Oracle" />
<sql-case id="create_table_with_xmltype_column_clob_oracle" value="CREATE TABLE xwarehouses (warehouse_id NUMBER, warehouse_spec XMLTYPE) XMLTYPE warehouse_spec STORE AS SECUREFILE CLOB (TABLESPACE auto_seg_ts STORAGE (INITIAL 6144) CACHE);" db-types="Oracle" />
-
<!-- TODO support create table with like and inherits on PostgreSQL-->
-<!-- <sql-case id="create_table_like" value="CREATE TABLE t_order_bak (LIKE t_order)" db-types="PostgreSQL" />-->
-<!-- <sql-case id="create_table_inherits" value="CREATE TABLE t_order_bak() inherits (t_order)" db-types="PostgreSQL" />-->
<sql-case id="create_table_with_bracket" value="CREATE TABLE [t_order] ([order_id] INT, [user_id] INT, [status] VARCHAR(10), [column1] VARCHAR(10), [column2] VARCHAR(10), [column3] VARCHAR(10))" db-types="SQLServer" />
<sql-case id="create_table_with_identity" value="CREATE TABLE t_order (order_id INT IDENTITY, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10))" db-types="SQLServer" />
<sql-case id="create_table_with_column_as" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column1 AS UPPER(status), column2 VARCHAR(10), column3 VARCHAR(10))" db-types="SQLServer" />
@@ -113,7 +102,6 @@
<sql-case id="create_table_with_inline_check_sqlserver" value="CREATE TABLE t_order (order_id INT CONSTRAINT chk_order_id CHECK (order_id > 0), user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10))" db-types="SQLServer" />
<sql-case id="create_table_with_inline_constraints_sqlserver" value="CREATE TABLE t_order (order_id INT PRIMARY KEY UNIQUE CHECK (order_id > 0), user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10))" db-types="SQLServer" />
<sql-case id="create_table_with_index" value="CREATE TABLE t_order (order_id INT INDEX order_index, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10))" db-types="SQLServer" />
- <sql-case id="create_gin_index" value="CREATE INDEX gin_idx ON t_order USING GIN (locations) WITH (fastupdate = off)" db-types="PostgreSQL" />
<sql-case id="create_table_with_range_partitioned_and_values" value="CREATE TABLE t_order PARTITION OF cities (CONSTRAINT city_id_nonzero CHECK (city_id != 0)) FOR VALUES IN ('a', 'b') PARTITION BY RANGE (population)" db-types="PostgreSQL" />
<sql-case id="create_table_partition_by_hash" value="CREATE TABLE t_order (order_id bigint not null,cust_id bigint not null,status text) PARTITION BY HASH (order_id)" db-types="PostgreSQL" />
<sql-case id="create_table_partition_by_list" value="CREATE TABLE t_order (city_id bigserial not null,name text not null,population bigint) PARTITION BY LIST (left(lower(name), 1))" db-types="PostgreSQL" />
@@ -121,114 +109,8 @@
<sql-case id="create_table_in_tablespace" value="CREATE TABLE t_order (id serial,name text,location text) TABLESPACE diskvol1" db-types="PostgreSQL" />
<sql-case id="create_table_with_sign_column" value="CREATE TABLE t_order(id INT PRIMARY KEY, order_id BIGINT(20) SIGNED)" db-types="MySQL" />
<sql-case id="create_table_with_unsigned_column" value="CREATE TABLE t_order(id INT PRIMARY KEY, order_id BIGINT(20) UNSIGNED)" db-types="MySQL" />
-
-<!-- create index test-->
- <sql-case id="create_index" value="CREATE INDEX t_log_index ON t_log (id)" db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
- <sql-case id="create_index_with_space" value=" CREATE INDEX
- order_index
- ON
- t_order (order_id) " db-types="MySQL,SQLServer" />
- <sql-case id="create_index_with_back_quota" value="CREATE INDEX `order_index` ON `t_order` (`order_id`)" db-types="MySQL" />
- <sql-case id="create_index_with_quota" value="CREATE INDEX "order_index" ON "t_order" ("order_id")" db-types="Oracle" />
- <sql-case id="create_index_with_function" value="CREATE INDEX idx_upper_status ON t_order (UPPER(status))" db-types="Oracle,PostgreSQL" />
- <sql-case id="create_index_with_bracket" value="CREATE INDEX [order_index] ON [t_order] ([order_id])" db-types="SQLServer" />
- <sql-case id="create_index_with_no_default_fill_factor" value="CREATE UNIQUE INDEX order_index ON t_order (order_id) WITH (fillfactor = 70)" db-types="PostgreSQL"/>
- <sql-case id="create_index_with_tablespace" value="CREATE INDEX code_idx ON t_order (code) TABLESPACE indexspace" db-types="PostgreSQL"/>
- <sql-case id="create_index_using_gist" value="CREATE INDEX pointloc ON t_order USING gist (func1(location,location))" db-types="PostgreSQL" />
- <sql-case id="create_index_with_concurrently" value="CREATE INDEX CONCURRENTLY sales_quantity_index ON t_order(quantity)" db-types="PostgreSQL" />
- <sql-case id="create_index_with_double_quota" value="CREATE INDEX "order_index" ON "t_order" ("order_id")" db-types="PostgreSQL" />
- <sql-case id="create_index_with_double_quota_and_uescape" value="CREATE INDEX U&"order_index!0061t!+000061" UESCAPE '!' ON u&"t_order" (u&"order_id")" db-types="PostgreSQL" />
- <sql-case id="create_index_concurrently" value="CREATE INDEX CONCURRENTLY order_index ON t_order (order_id)" db-types="PostgreSQL" />
- <sql-case id="create_index_if_not_exists" value="CREATE INDEX IF NOT EXISTS order_index ON t_order (order_id)" db-types="PostgreSQL" />
- <sql-case id="create_index_using_btree" value="CREATE INDEX order_index ON t_order (order_id) USING BTREE" db-types="PostgreSQL" />
- <sql-case id="create_index_with_unique" value="CREATE UNIQUE INDEX order_index ON t_order (order_id)" db-types="Oracle" />
- <sql-case id="create_index_with_usable" value="CREATE UNIQUE INDEX order_index ON t_order (order_id) USABLE" db-types="Oracle" />
- <sql-case id="create_index_with_unusable" value="CREATE UNIQUE INDEX order_index ON t_order (order_id) UNUSABLE" db-types="Oracle" />
- <sql-case id="create_index_with_immediate_invalidation" value="CREATE UNIQUE INDEX order_index ON t_order (order_id) IMMEDIATE INVALIDATION" db-types="Oracle" />
- <sql-case id="create_index_with_cluster_index" value="CREATE UNIQUE INDEX order_index ON CLUSTER t_cluster" db-types="Oracle" />
- <sql-case id="create_index_with_bitmap" value="CREATE BITMAP INDEX order_index ON t_order (order_id)" db-types="Oracle" />
-
-<!-- create database test-->
- <sql-case id="create_database" value="CREATE DATABASE lusiadas" db-types="PostgreSQL" />
- <sql-case id="create_database_owner" value="CREATE DATABASE sales OWNER salesapp TABLESPACE salesspace" db-types="PostgreSQL" />
- <sql-case id="create_database_with_location_and_encoding" value="CREATE DATABASE music2
- LC_COLLATE 'sv_SE.iso885915' LC_CTYPE 'sv_SE.iso885915'
- ENCODING LATIN9
- TEMPLATE template0" db-types="PostgreSQL" />
- <sql-case id="create_database_with_location" value="CREATE DATABASE music
- LC_COLLATE 'sv_SE.utf8' LC_CTYPE 'sv_SE.utf8'
- TEMPLATE template0" db-types="PostgreSQL" />
-
-<!-- create function test-->
- <sql-case id="create_function" value="CREATE FUNCTION add(integer, integer) RETURNS integer
- AS 'select $1 + $2;'
- LANGUAGE SQL
- IMMUTABLE
- RETURNS NULL ON NULL INPUT" db-types="PostgreSQL" />
- <sql-case id="create_function_with_argname" value="CREATE OR REPLACE FUNCTION increment(i integer) RETURNS integer AS
- $$
- BEGIN
- RETURN i + 1;
- END;
- $$ LANGUAGE plpgsql" db-types="PostgreSQL" />
- <sql-case id="create_function_with_multiple_output_parameters" value="CREATE FUNCTION dup(in int, out f1 int, out f2 text)
- AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
- LANGUAGE SQL" db-types="PostgreSQL" />
- <sql-case id="create_function_return_table" value="CREATE FUNCTION dup(int) RETURNS TABLE(f1 int, f2 text)
- AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$
- LANGUAGE SQL" db-types="PostgreSQL" />
-
-<!-- create procedure test-->
- <sql-case id="create_procedure" value="CREATE PROCEDURE insert_data(a integer, b integer)
- LANGUAGE SQL
- AS $$
- INSERT INTO tbl VALUES (a);
- INSERT INTO tbl VALUES (b);
- $$" db-types="PostgreSQL" />
-
-<!-- create server test-->
-<!-- <sql-case id="create_server" value="CREATE SERVER myserver FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'foo', dbname 'foodb', port '5432')" db-types="PostgreSQL" />-->
-
-<!-- create trigger test-->
-<!-- <sql-case id="create_trigger" value="CREATE TRIGGER check_update-->
-<!-- BEFORE UPDATE ON accounts-->
-<!-- FOR EACH ROW-->
-<!-- EXECUTE FUNCTION check_account_update()" db-types="PostgreSQL" />-->
-<!-- <sql-case id="create_trigger_of_balance" value="CREATE TRIGGER check_update-->
-<!-- BEFORE UPDATE OF balance ON accounts-->
-<!-- FOR EACH ROW-->
-<!-- EXECUTE FUNCTION check_account_update()" db-types="PostgreSQL" />-->
-<!-- <sql-case id="create_trigger_with_when" value="CREATE TRIGGER check_update-->
-<!-- BEFORE UPDATE ON accounts-->
-<!-- FOR EACH ROW-->
-<!-- WHEN (OLD.balance IS DISTINCT FROM NEW.balance)-->
-<!-- EXECUTE FUNCTION check_account_update()" db-types="PostgreSQL" />-->
-<!-- <sql-case id="create_trigger_after_update" value="CREATE TRIGGER paired_items_update-->
-<!-- AFTER UPDATE ON paired_items-->
-<!-- REFERENCING NEW TABLE AS newtab OLD TABLE AS oldtab-->
-<!-- FOR EACH ROW-->
-<!-- EXECUTE FUNCTION check_matching_pairs()" db-types="PostgreSQL" />-->
-
-<!-- create view test-->
- <sql-case id="create_view" value="CREATE VIEW comedies AS
- SELECT *
- FROM films
- WHERE kind = 'Comedy'" db-types="PostgreSQL" />
- <sql-case id="create_view_with_check_option" value="CREATE VIEW universal_comedies AS
- SELECT *
- FROM comedies
- WHERE classification = 'U'
- WITH LOCAL CHECK OPTION" db-types="PostgreSQL" />
- <sql-case id="create_view_with_recursive" value="CREATE RECURSIVE VIEW public.nums_1_100 (n) AS
- VALUES (1)
- UNION ALL
- SELECT n+1 FROM nums_1_100 WHERE n = 100" db-types="PostgreSQL" />
<sql-case id="create_table_with_on_update_current_timestamp" value="CREATE TABLE t_order (order_id INT PRIMARY KEY, create_time DATETIME DEFAULT CURRENT_TIMESTAMP, modify_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP)" db-types="MySQL" />
<sql-case id="create_table_with_on_update_current_timestamp_and_fsp" value="CREATE TABLE t_order (order_id INT PRIMARY KEY, create_time DATETIME DEFAULT CURRENT_TIMESTAMP, modify_time DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6))" db-types="MySQL" />
<sql-case id="create_table_with_on_other_vendor_data_type" value="CREATE TABLE t_order (order_id INT PRIMARY KEY, num MIDDLEINT(10))" db-types="MySQL" />
<sql-case id="create_table_with_enum_and_character_set" value="CREATE TABLE t_order (order_id INT PRIMARY KEY, status ENUM('0', '1') CHARACTER SET UTF8)" db-types="MySQL" />
-<!-- create sequence test-->
- <sql-case id="create_sequence" value="CREATE SEQUENCE seq_id" db-types="PostgreSQL" />
- <sql-case id="create_sequence_with_option" value="CREATE SEQUENCE TEMPORARY seq_option" db-types="PostgreSQL" />
- <sql-case id="create_sequence_complex" value="CREATE SEQUENCE seq_complex MINVALUE 0 MAXVALUE 100 START 0" db-types="PostgreSQL" />
</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-view.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-view.xml
new file mode 100644
index 0000000..fca1d58
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create-view.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="create_view" value="CREATE VIEW comedies AS
+ SELECT *
+ FROM films
+ WHERE kind = 'Comedy'" db-types="PostgreSQL" />
+ <sql-case id="create_view_with_check_option" value="CREATE VIEW universal_comedies AS
+ SELECT *
+ FROM comedies
+ WHERE classification = 'U'
+ WITH LOCAL CHECK OPTION" db-types="PostgreSQL" />
+ <sql-case id="create_view_with_recursive" value="CREATE RECURSIVE VIEW public.nums_1_100 (n) AS
+ VALUES (1)
+ UNION ALL
+ SELECT n+1 FROM nums_1_100 WHERE n = 100" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-database.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-database.xml
new file mode 100644
index 0000000..a835ae0
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-database.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="drop_database_if_exist" value="DROP DATABASE IF EXISTS database1" db-types="PostgreSQL" />
+ <sql-case id="drop_database" value="DROP DATABASE database1" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-function.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-function.xml
new file mode 100644
index 0000000..da8480d
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-function.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="drop_function" value="DROP FUNCTION sqrt(integer)" db-types="PostgreSQL" />
+ <sql-case id="drop_functions" value="DROP FUNCTION sqrt(integer), sqrt(bigint)" db-types="PostgreSQL" />
+ <sql-case id="drop_function_without_argument_list" value="DROP FUNCTION update_employee_salaries" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-index.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-index.xml
new file mode 100644
index 0000000..bf933ee
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-index.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="drop_index" value="DROP INDEX t_log_index ON t_log" db-types="MySQL,SQLServer" />
+ <sql-case id="drop_index_without_on" value="DROP INDEX order_index" db-types="PostgreSQL,Oracle" />
+ <sql-case id="drop_index_if_exists" value="DROP INDEX IF EXISTS order_index" db-types="PostgreSQL" />
+ <sql-case id="drop_index_with_space" value=" DROP INDEX
+ order_index
+ ON
+ t_order " db-types="MySQL,SQLServer" />
+ <sql-case id="drop_index_only_with_name" value="DROP INDEX order_index" db-types="Oracle,PostgreSQL" />
+ <sql-case id="drop_index_with_back_quota" value="DROP INDEX `order_index` ON `t_order`" db-types="MySQL" />
+ <sql-case id="drop_index_with_quota" value="DROP INDEX "order_index" ON "t_order"" db-types="Oracle" />
+ <sql-case id="drop_index_with_double_quota" value="DROP INDEX "order_index"" db-types="PostgreSQL" />
+ <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>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-procedure.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-procedure.xml
new file mode 100644
index 0000000..f5c0dee
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-procedure.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="drop_procedure" value="DROP PROCEDURE do_db_maintenance()" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-sequence.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-sequence.xml
new file mode 100644
index 0000000..475eb75
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-sequence.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="drop_sequence" value="DROP SEQUENCE seq_id" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-table.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-table.xml
new file mode 100644
index 0000000..4cc90a7
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-table.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="drop_table" value="DROP TABLE t_log" />
+ <sql-case id="drop_table_if_exists" value="DROP TABLE IF EXISTS t_log" db-types="MySQL,PostgreSQL,SQLServer" />
+ <sql-case id="drop_temporary_table_if_exists" value="DROP TEMPORARY TABLE IF EXISTS t_temp_log" db-types="MySQL" />
+ <sql-case id="drop_table_restrict" value="DROP TABLE t_log RESTRICT" db-types="MySQL,PostgreSQL" />
+ <sql-case id="drop_table_cascade" value="DROP TABLE t_log CASCADE" db-types="MySQL,PostgreSQL" />
+ <sql-case id="drop_table_cascade_constraints_and_purge" value="DROP TABLE t_log CASCADE CONSTRAINTS PURGE" db-types="Oracle" />
+ <sql-case id="drop_table_purge_with_schema" value="DROP TABLE sharding_db.t_log PURGE" db-types="Oracle" />
+ <sql-case id="drop_table_with_space" value=" DROP TABLE
+ t_order "/>
+ <sql-case id="drop_table_with_back_quota" value="DROP TABLE `t_order`" left-delimiter="`" right-delimiter="`" db-types="MySQL" />
+ <sql-case id="drop_tables" value="DROP TABLE t_order_item, t_order" db-types="MySQL,PostgreSQL,SQLServer" />
+ <sql-case id="drop_temporary_table" value="DROP TEMPORARY TABLE t_order" db-types="MySQL" />
+ <sql-case id="drop_table_with_quota" value="DROP TABLE "t_order"" db-types="Oracle" />
+ <sql-case id="drop_table_with_double_quota" value="DROP TABLE "t_order"" db-types="PostgreSQL" />
+ <sql-case id="drop_table_with_bracket" value="DROP TABLE [t_order]" db-types="SQLServer" />
+</sql-cases>
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-view.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-view.xml
new file mode 100644
index 0000000..475db41
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop-view.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<sql-cases>
+ <sql-case id="drop_view" value="DROP VIEW kinds" db-types="PostgreSQL" />
+</sql-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
deleted file mode 100644
index 94eff52..0000000
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/drop.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<sql-cases>
- <sql-case id="drop_table" value="DROP TABLE t_log" />
- <sql-case id="drop_table_if_exists" value="DROP TABLE IF EXISTS t_log" db-types="MySQL,PostgreSQL,SQLServer" />
- <sql-case id="drop_temporary_table_if_exists" value="DROP TEMPORARY TABLE IF EXISTS t_temp_log" db-types="MySQL" />
- <sql-case id="drop_table_restrict" value="DROP TABLE t_log RESTRICT" db-types="MySQL,PostgreSQL" />
- <sql-case id="drop_table_cascade" value="DROP TABLE t_log CASCADE" db-types="MySQL,PostgreSQL" />
- <sql-case id="drop_table_cascade_constraints_and_purge" value="DROP TABLE t_log CASCADE CONSTRAINTS PURGE" db-types="Oracle" />
- <sql-case id="drop_table_purge_with_schema" value="DROP TABLE sharding_db.t_log PURGE" db-types="Oracle" />
- <sql-case id="drop_table_with_space" value=" DROP TABLE
- t_order "/>
- <sql-case id="drop_table_with_back_quota" value="DROP TABLE `t_order`" left-delimiter="`" right-delimiter="`" db-types="MySQL" />
- <sql-case id="drop_tables" value="DROP TABLE t_order_item, t_order" db-types="MySQL,PostgreSQL,SQLServer" />
- <sql-case id="drop_temporary_table" value="DROP TEMPORARY TABLE t_order" db-types="MySQL" />
- <sql-case id="drop_table_with_quota" value="DROP TABLE "t_order"" db-types="Oracle" />
- <sql-case id="drop_table_with_double_quota" value="DROP TABLE "t_order"" db-types="PostgreSQL" />
- <sql-case id="drop_table_with_bracket" value="DROP TABLE [t_order]" db-types="SQLServer" />
- <sql-case id="drop_database_if_exist" value="DROP DATABASE IF EXISTS database1" db-types="PostgreSQL" />
- <sql-case id="drop_database" value="DROP DATABASE database1" db-types="PostgreSQL" />
- <sql-case id="drop_function" value="DROP FUNCTION sqrt(integer)" db-types="PostgreSQL" />
- <sql-case id="drop_functions" value="DROP FUNCTION sqrt(integer), sqrt(bigint)" db-types="PostgreSQL" />
- <sql-case id="drop_function_without_argument_list" value="DROP FUNCTION update_employee_salaries" db-types="PostgreSQL" />
- <sql-case id="drop_procedure" value="DROP PROCEDURE do_db_maintenance()" db-types="PostgreSQL" />
-<!-- <sql-case id="drop_server_if_exists" value="DROP SERVER IF EXISTS foo" db-types="PostgreSQL" />-->
-<!-- <sql-case id="drop_server" value="DROP SERVER foo" db-types="PostgreSQL" />-->
-<!-- <sql-case id="drop_trigger" value="DROP TRIGGER if_dist_exists ON films" db-types="PostgreSQL" />-->
- <sql-case id="drop_view" value="DROP VIEW kinds" db-types="PostgreSQL" />
-<!--drop index test-->
- <sql-case id="drop_index" value="DROP INDEX t_log_index ON t_log" db-types="MySQL,SQLServer" />
- <sql-case id="drop_index_without_on" value="DROP INDEX order_index" db-types="PostgreSQL,Oracle" />
- <sql-case id="drop_index_if_exists" value="DROP INDEX IF EXISTS order_index" db-types="PostgreSQL" />
- <sql-case id="drop_index_with_space" value=" DROP INDEX
- order_index
- ON
- t_order " db-types="MySQL,SQLServer" />
- <sql-case id="drop_index_only_with_name" value="DROP INDEX order_index" db-types="Oracle,PostgreSQL" />
- <sql-case id="drop_index_with_back_quota" value="DROP INDEX `order_index` ON `t_order`" db-types="MySQL" />
- <sql-case id="drop_index_with_quota" value="DROP INDEX "order_index" ON "t_order"" db-types="Oracle" />
- <sql-case id="drop_index_with_double_quota" value="DROP INDEX "order_index"" db-types="PostgreSQL" />
- <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" />
-<!-- drop sequence test-->
- <sql-case id="drop_sequence" value="DROP SEQUENCE seq_id" db-types="PostgreSQL" />
-</sql-cases>