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 2022/11/17 03:28:00 UTC

[shardingsphere] branch master updated: Enable federation config in transaction IT (#22224)

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 c7dc0500989 Enable federation config in transaction IT (#22224)
c7dc0500989 is described below

commit c7dc0500989e90f0b02fede5a0499de9bdaca462
Author: ZhangCheng <fl...@outlook.com>
AuthorDate: Thu Nov 17 11:27:54 2022 +0800

    Enable federation config in transaction IT (#22224)
    
    * Enable federation in transaction IT
    
    * Fix view
---
 .../transaction/cases/cursor/OpenGaussCursorTestCase.java          | 7 -------
 .../src/test/resources/env/jdbc/mysql/config-sharding-local.yaml   | 3 ++-
 .../test/resources/env/jdbc/mysql/config-sharding-xa-atomikos.yaml | 3 ++-
 .../test/resources/env/jdbc/mysql/config-sharding-xa-bitronix.yaml | 3 ++-
 .../test/resources/env/jdbc/opengauss/config-sharding-local.yaml   | 3 ++-
 .../resources/env/jdbc/opengauss/config-sharding-xa-atomikos.yaml  | 3 ++-
 .../resources/env/jdbc/opengauss/config-sharding-xa-bitronix.yaml  | 3 ++-
 .../resources/env/jdbc/opengauss/config-sharding-xa-narayana.yaml  | 3 ++-
 .../test/resources/env/jdbc/postgresql/config-sharding-local.yaml  | 3 ++-
 .../resources/env/jdbc/postgresql/config-sharding-xa-atomikos.yaml | 3 ++-
 .../resources/env/jdbc/postgresql/config-sharding-xa-bitronix.yaml | 3 ++-
 .../resources/env/jdbc/postgresql/config-sharding-xa-narayana.yaml | 3 ++-
 .../transaction/src/test/resources/env/opengauss/server.yaml       | 2 +-
 .../transaction/src/test/resources/env/postgresql/server.yaml      | 2 +-
 .../cursor/data/actual/init-sql/opengauss/01-actual-init.sql       | 4 ++++
 15 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/cursor/OpenGaussCursorTestCase.java b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/cursor/OpenGaussCursorTestCase.java
index c7310e715ff..ba4a6cb9e98 100644
--- a/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/cursor/OpenGaussCursorTestCase.java
+++ b/test/integration-test/transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/cursor/OpenGaussCursorTestCase.java
@@ -55,13 +55,6 @@ public final class OpenGaussCursorTestCase extends BaseTransactionTestCase {
         return JAXB.unmarshal(Objects.requireNonNull(BaseITCase.class.getClassLoader().getResource("env/common/cursor-command.xml")), CursorSQLCommand.class);
     }
     
-    @Override
-    protected void beforeTest() throws SQLException {
-        super.beforeTest();
-        Connection connection = getDataSource().getConnection();
-        executeWithLog(connection, "CREATE OR REPLACE VIEW t_order_view AS SELECT * FROM t_order;");
-    }
-    
     @Override
     public void executeTest() throws SQLException {
         Connection connection = getDataSource().getConnection();
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-local.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-local.yaml
index b59153145dd..0faf688e791 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-local.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-local.yaml
@@ -96,4 +96,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-atomikos.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-atomikos.yaml
index 2ad3f77d79a..c3a2718b63b 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-atomikos.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-atomikos.yaml
@@ -97,4 +97,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-bitronix.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-bitronix.yaml
index 470f2f1351e..40420db276a 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-bitronix.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-bitronix.yaml
@@ -97,4 +97,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-local.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-local.yaml
index b59153145dd..0faf688e791 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-local.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-local.yaml
@@ -96,4 +96,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-atomikos.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-atomikos.yaml
index 2ad3f77d79a..c3a2718b63b 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-atomikos.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-atomikos.yaml
@@ -97,4 +97,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-bitronix.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-bitronix.yaml
index 470f2f1351e..40420db276a 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-bitronix.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-bitronix.yaml
@@ -97,4 +97,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-narayana.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-narayana.yaml
index 6ff537dd448..46eb2bdecaa 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-narayana.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-narayana.yaml
@@ -97,4 +97,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-local.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-local.yaml
index b59153145dd..0faf688e791 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-local.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-local.yaml
@@ -96,4 +96,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-atomikos.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-atomikos.yaml
index 2ad3f77d79a..c3a2718b63b 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-atomikos.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-atomikos.yaml
@@ -97,4 +97,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-bitronix.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-bitronix.yaml
index 470f2f1351e..40420db276a 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-bitronix.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-bitronix.yaml
@@ -97,4 +97,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-narayana.yaml b/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-narayana.yaml
index 6ff537dd448..46eb2bdecaa 100644
--- a/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-narayana.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-narayana.yaml
@@ -97,4 +97,5 @@ rules:
         type: SNOWFLAKE
 
 props:
-  sql-show: false
+  sql-show: true
+  sql-federation-type: ADVANCED
diff --git a/test/integration-test/transaction/src/test/resources/env/opengauss/server.yaml b/test/integration-test/transaction/src/test/resources/env/opengauss/server.yaml
index b819cf6113c..1885167a386 100644
--- a/test/integration-test/transaction/src/test/resources/env/opengauss/server.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/opengauss/server.yaml
@@ -44,6 +44,6 @@ props:
   proxy-backend-query-fetch-size: -1
   proxy-backend-executor-suitable: OLAP
   proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
-  sql-federation-type: NONE
+  sql-federation-type: ADVANCED
   proxy-backend-driver-type: JDBC
   proxy-frontend-database-protocol-type: openGauss
diff --git a/test/integration-test/transaction/src/test/resources/env/postgresql/server.yaml b/test/integration-test/transaction/src/test/resources/env/postgresql/server.yaml
index e4c575a75ca..0cdbf4008cd 100644
--- a/test/integration-test/transaction/src/test/resources/env/postgresql/server.yaml
+++ b/test/integration-test/transaction/src/test/resources/env/postgresql/server.yaml
@@ -49,7 +49,7 @@ props:
   # and block other clients if client connections are more than `proxy-frontend-executor-size`, especially executing slow SQL.
   proxy-backend-executor-suitable: OLAP
   proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
-  sql-federation-type: NONE
+  sql-federation-type: ADVANCED
   # Available proxy backend driver type: JDBC (default), ExperimentalVertx
   proxy-backend-driver-type: JDBC
   proxy-frontend-database-protocol-type: PostgreSQL
diff --git a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/opengauss/01-actual-init.sql b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/opengauss/01-actual-init.sql
index 655516bf8d2..b335498c983 100644
--- a/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/opengauss/01-actual-init.sql
+++ b/test/integration-test/transaction/src/test/resources/env/scenario/cursor/data/actual/init-sql/opengauss/01-actual-init.sql
@@ -45,6 +45,8 @@ CREATE TABLE "t_order_0" ("order_id" INT PRIMARY KEY, "address_id" INT, "user_id
 CREATE TABLE "t_order_1" ("order_id" INT PRIMARY KEY, "address_id" INT, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
 CREATE TABLE "t_order_item_0" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
 CREATE TABLE "t_order_item_1" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE OR REPLACE VIEW t_order_view_0 AS SELECT * FROM t_order_0;
+CREATE OR REPLACE VIEW t_order_view_1 AS SELECT * FROM t_order_1;
 CREATE TABLE "account_0"("ID" BIGINT, "BALANCE" FLOAT, "TRANSACTION_ID" INT);
 CREATE TABLE "account_1"("ID" BIGINT, "BALANCE" FLOAT, "TRANSACTION_ID" INT);
 CREATE TABLE "t_address" ("address_id" INT PRIMARY KEY, "code" VARCHAR(36) DEFAULT NULL, "address" VARCHAR(36) DEFAULT NULL, "city_id" INT, "province_id" INT, "country_id" INT);
@@ -81,6 +83,8 @@ CREATE TABLE "t_order_0" ("order_id" INT PRIMARY KEY, "address_id" INT, "user_id
 CREATE TABLE "t_order_1" ("order_id" INT PRIMARY KEY, "address_id" INT, "user_id" INT NOT NULL, "status" VARCHAR(45) NULL);
 CREATE TABLE "t_order_item_0" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
 CREATE TABLE "t_order_item_1" ("item_id" INT PRIMARY KEY, "order_id" int NOT NULL, "user_id" int NOT NULL, "status" varchar(50) DEFAULT NULL);
+CREATE OR REPLACE VIEW t_order_view_0 AS SELECT * FROM t_order_0;
+CREATE OR REPLACE VIEW t_order_view_1 AS SELECT * FROM t_order_1;
 CREATE TABLE "account_0"("ID" BIGINT, "BALANCE" FLOAT, "TRANSACTION_ID" INT);
 CREATE TABLE "account_1"("ID" BIGINT, "BALANCE" FLOAT, "TRANSACTION_ID" INT);
 CREATE TABLE "t_address" ("address_id" INT PRIMARY KEY, "code" VARCHAR(36) DEFAULT NULL, "address" VARCHAR(36) DEFAULT NULL, "city_id" INT, "province_id" INT, "country_id" INT);