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 2022/05/30 09:43:39 UTC
[shardingsphere] branch master updated: add test case for parsing view (#18065)
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 671a18cc677 add test case for parsing view (#18065)
671a18cc677 is described below
commit 671a18cc677d41b28c0c14df15fa93131a4b679d
Author: Chuxin Chen <ch...@qq.com>
AuthorDate: Mon May 30 17:43:32 2022 +0800
add test case for parsing view (#18065)
---
.../src/main/resources/case/ddl/alter-view.xml | 7 +++++++
.../src/main/resources/case/ddl/create-view.xml | 1 +
.../src/main/resources/case/ddl/drop-view.xml | 1 +
.../src/main/resources/sql/supported/ddl/alter-view.xml | 7 +++++++
.../src/main/resources/sql/supported/ddl/create-view.xml | 1 +
.../src/main/resources/sql/supported/ddl/drop-view.xml | 3 ++-
6 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/alter-view.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/alter-view.xml
index 7cbccd1ec29..0330f40d44b 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/alter-view.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/alter-view.xml
@@ -18,4 +18,11 @@
<sql-parser-test-cases>
<alter-view sql-case-id="alter_view" />
+ <alter-view sql-case-id="alter_view_set_default_column" />
+ <alter-view sql-case-id="alter_view_drop_default" />
+ <alter-view sql-case-id="alter_view_owner" />
+ <alter-view sql-case-id="alter_view_rename" />
+ <alter-view sql-case-id="alter_view_set_schema" />
+ <alter-view sql-case-id="alter_view_set_view_option" />
+ <alter-view sql-case-id="alter_view_reset" />
</sql-parser-test-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/create-view.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/create-view.xml
index 7507764bcf8..ed9a94da78d 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/create-view.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/create-view.xml
@@ -20,4 +20,5 @@
<create-view sql-case-id="create_view" />
<create-view sql-case-id="create_view_with_check_option" />
<create-view sql-case-id="create_view_with_recursive" />
+ <create-view sql-case-id="create_view_with_option" />
</sql-parser-test-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/drop-view.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/drop-view.xml
index 3191098c4cb..7cf571b58f6 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/drop-view.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/drop-view.xml
@@ -20,4 +20,5 @@
<drop-view sql-case-id="drop_view" />
<drop-view sql-case-id="drop_view_with_schemaname" />
<drop-view sql-case-id="drop_view_cascade_constraints" />
+ <drop-view sql-case-id="drop_view_cascade" />
</sql-parser-test-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/alter-view.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/alter-view.xml
index 96c7cd07c7a..9933ebcba85 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/alter-view.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/alter-view.xml
@@ -18,4 +18,11 @@
<sql-cases>
<sql-case id="alter_view" value="ALTER VIEW customer_ro COMPILE;" db-types="Oracle" />
+ <sql-case id="alter_view_set_default_column" value="ALTER VIEW order_view ALTER COLUMN status SET DEFAULT 'UP'" db-types="PostgreSQL,openGauss" />
+ <sql-case id="alter_view_drop_default" value="ALTER VIEW order_view ALTER COLUMN status DROP DEFAULT" db-types="PostgreSQL,openGauss" />
+ <sql-case id="alter_view_owner" value="ALTER VIEW order_view OWNER TO test" db-types="PostgreSQL,openGauss" />
+ <sql-case id="alter_view_rename" value="ALTER VIEW order_view RENAME TO new_order_view" db-types="PostgreSQL,openGauss" />
+ <sql-case id="alter_view_set_schema" value="ALTER VIEW order_view SET SCHEMA test" db-types="PostgreSQL,openGauss" />
+ <sql-case id="alter_view_set_view_option" value="ALTER VIEW order_view SET (security_barrier=TRUE)" db-types="PostgreSQL,openGauss" />
+ <sql-case id="alter_view_reset" value="ALTER VIEW order_view RESET (security_barrier)" db-types="PostgreSQL,openGauss" />
</sql-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/create-view.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/create-view.xml
index 1e654d6eac5..6a4c3688ec1 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/create-view.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/create-view.xml
@@ -30,4 +30,5 @@
VALUES (1)
UNION ALL
SELECT n+1 FROM nums_1_100 WHERE n = 100" db-types="PostgreSQL,openGauss" />
+ <sql-case id="create_view_with_option" value="CREATE OR REPLACE TEMP view order_view (order_id,user_id) WITH (security_barrier=TRUE) AS SELECT * FROM t_order" db-types="PostgreSQL,openGauss" />
</sql-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/drop-view.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/drop-view.xml
index c5949c3b8a3..581013bfd7c 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/drop-view.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/drop-view.xml
@@ -17,7 +17,8 @@
-->
<sql-cases>
- <sql-case id="drop_view" value="DROP VIEW kinds" db-types="PostgreSQL,openGauss, SQLServer, Oracle" />
+ <sql-case id="drop_view" value="DROP VIEW kinds" db-types="PostgreSQL, openGauss, SQLServer, Oracle" />
<sql-case id="drop_view_with_schemaname" value="DROP VIEW schemaName.viewName;" db-types="Oracle" />
<sql-case id="drop_view_cascade_constraints" value="DROP VIEW schemaName.viewName CASCADE CONSTRAINTS;" db-types="Oracle" />
+ <sql-case id="drop_view_cascade" value="DROP VIEW kinds, order_view CASCADE" db-types="PostgreSQL, openGauss" />
</sql-cases>