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/22 11:08:02 UTC
[shardingsphere] branch master updated: move federate test to
integration-test (#10913)
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 9c8adc6 move federate test to integration-test (#10913)
9c8adc6 is described below
commit 9c8adc6080a9535c97275c1f277b1eebd0e21280
Author: Zhengqiang Duan <st...@gmail.com>
AuthorDate: Tue Jun 22 19:07:30 2021 +0800
move federate test to integration-test (#10913)
* move federate test to integration-test
* add integration-test to other database
* remove federate test
---
.../statement/FederatePrepareStatementTest.java | 30 ----------------------
.../jdbc/core/statement/FederateStatementTest.java | 29 ---------------------
.../test/integration/env/EnvironmentPath.java | 30 +++++++++++++++++++++-
.../junit/container/storage/impl/H2Container.java | 17 +++++++++---
.../select_across_single_tables_with_federate.xml} | 23 +++++++++--------
.../select_across_single_tables_with_federate.xml} | 23 +++++++++--------
.../select_across_single_tables_with_federate.xml} | 23 +++++++++--------
.../cases/dql/dql-integration-test-cases.xml | 4 +++
.../src/test/resources/env/db/dataset.xml | 17 ++++++++++++
.../resources/env/db/init-sql/h2/init-db_0.sql | 20 +++++++++++++++
.../resources/env/db/init-sql/h2/init-db_1.sql | 20 +++++++++++++++
.../test/resources/env/db/init-sql/mysql/init.sql | 2 ++
.../test/resources/env/db/init-sql/oracle/init.sql | 2 ++
.../resources/env/db/init-sql/sqlserver/init.sql | 2 ++
.../env/dbtbl_with_readwrite_splitting/dataset.xml | 23 +++++++++++++++++
.../init-sql/h2/init-read_ds_0.sql | 20 +++++++++++++++
.../init-sql/h2/init-read_ds_1.sql | 20 +++++++++++++++
.../init-sql/h2/init-write_ds_0.sql | 20 +++++++++++++++
.../init-sql/h2/init-write_ds_1.sql | 20 +++++++++++++++
.../init-sql/mysql/init.sql | 4 +++
.../init-sql/oracle/init.sql | 4 +++
.../init-sql/sqlserver/init.sql | 4 +++
.../dataset.xml | 23 +++++++++++++++++
.../init-sql/h2/init-encrypt_read_ds_0.sql | 20 +++++++++++++++
.../init-sql/h2/init-encrypt_read_ds_1.sql | 20 +++++++++++++++
.../init-sql/h2/init-encrypt_write_ds_0.sql | 20 +++++++++++++++
.../init-sql/h2/init-encrypt_write_ds_1.sql | 20 +++++++++++++++
.../init-sql/mysql/init.sql | 4 +++
.../init-sql/oracle/init.sql | 4 +++
.../init-sql/sqlserver/init.sql | 4 +++
.../src/test/resources/logback-test.xml | 4 +++
31 files changed, 380 insertions(+), 96 deletions(-)
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/FederatePrepareStatementTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/FederatePrepareStatementTest.java
index 6949d53..7e8bfc6 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/FederatePrepareStatementTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/FederatePrepareStatementTest.java
@@ -32,9 +32,6 @@ import static org.junit.Assert.assertTrue;
public final class FederatePrepareStatementTest extends AbstractShardingSphereDataSourceForFederateTest {
- private static final String SELECT_SQL_BY_ID_ACROSS_SINGLE_TABLES =
- "select o.*, i.* from t_order_federate o, t_order_item_federate i where o.order_id = ? and i.item_id = ?";
-
private static final String SELECT_SQL_BY_ID_ACROSS_SINGLE_AND_SHARDING_TABLES =
"select t_order_federate.*, t_order_item_federate_sharding.* "
+ "from t_order_federate, t_order_item_federate_sharding "
@@ -72,33 +69,6 @@ public final class FederatePrepareStatementTest extends AbstractShardingSphereDa
private static final String SELECT_PARTIAL_DISTINCT_AGGREGATION_SQL_FOR_SHARDING_TABLE =
"SELECT SUM(DISTINCT user_id), SUM(order_id_sharding) FROM t_order_federate_sharding WHERE order_id_sharding > ?";
-
- @Test
- public void assertQueryWithFederateInSingleTablesByExecuteQuery() throws SQLException {
- assertQueryWithFederateInSingleTables(true);
- }
-
- @Test
- public void assertQueryWithFederateInSingleTablesByExecute() throws SQLException {
- assertQueryWithFederateInSingleTables(false);
- }
-
- private void assertQueryWithFederateInSingleTables(final boolean executeQuery) throws SQLException {
- ShardingSpherePreparedStatement preparedStatement = (ShardingSpherePreparedStatement) getShardingSphereDataSource().getConnection().prepareStatement(SELECT_SQL_BY_ID_ACROSS_SINGLE_TABLES);
- preparedStatement.setInt(1, 1000);
- preparedStatement.setInt(2, 100000);
- ResultSet resultSet = getResultSet(preparedStatement, executeQuery);
- assertNotNull(resultSet);
- assertTrue(resultSet.next());
- assertThat(resultSet.getInt(1), is(1000));
- assertThat(resultSet.getInt(2), is(10));
- assertThat(resultSet.getString(3), is("init"));
- assertThat(resultSet.getInt(4), is(100000));
- assertThat(resultSet.getInt(5), is(1000));
- assertThat(resultSet.getInt(6), is(10));
- assertThat(resultSet.getString(7), is("init"));
- assertFalse(resultSet.next());
- }
@Test
public void assertQueryWithFederateInSingleAndShardingTableByExecuteQuery() throws SQLException {
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/FederateStatementTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/FederateStatementTest.java
index 9688e10..709bc03 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/FederateStatementTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/FederateStatementTest.java
@@ -32,10 +32,6 @@ import static org.junit.Assert.assertTrue;
public final class FederateStatementTest extends AbstractShardingSphereDataSourceForFederateTest {
- private static final String SELECT_SQL_BY_ID_ACROSS_SINGLE_TABLES =
- "select o.*, i.* from t_order_federate o, t_order_item_federate i "
- + "where o.order_id = 1000 and i.item_id = 100000";
-
private static final String SELECT_SQL_BY_ID_ACROSS_SINGLE_AND_SHARDING_TABLES =
"select t_order_federate.*, t_order_item_federate_sharding.* from t_order_federate, "
+ "t_order_item_federate_sharding where t_order_federate.order_id = "
@@ -77,31 +73,6 @@ public final class FederateStatementTest extends AbstractShardingSphereDataSourc
"SELECT SUM(DISTINCT user_id), SUM(order_id_sharding) FROM t_order_federate_sharding WHERE order_id_sharding > 1000";
@Test
- public void assertQueryWithFederateInSingleTablesByExecuteQuery() throws SQLException {
- assertQueryWithFederateInSingleTables(true);
- }
-
- @Test
- public void assertQueryWithFederateInSingleTablesByExecute() throws SQLException {
- assertQueryWithFederateInSingleTables(false);
- }
-
- private void assertQueryWithFederateInSingleTables(final boolean executeQuery) throws SQLException {
- ShardingSphereStatement statement = (ShardingSphereStatement) getShardingSphereDataSource().getConnection().createStatement();
- ResultSet resultSet = getResultSet(statement, SELECT_SQL_BY_ID_ACROSS_SINGLE_TABLES, executeQuery);
- assertNotNull(resultSet);
- assertTrue(resultSet.next());
- assertThat(resultSet.getInt(1), is(1000));
- assertThat(resultSet.getInt(2), is(10));
- assertThat(resultSet.getString(3), is("init"));
- assertThat(resultSet.getInt(4), is(100000));
- assertThat(resultSet.getInt(5), is(1000));
- assertThat(resultSet.getInt(6), is(10));
- assertThat(resultSet.getString(7), is("init"));
- assertFalse(resultSet.next());
- }
-
- @Test
public void assertQueryWithFederateInSingleAndShardingTableByExecuteQuery() throws SQLException {
assertQueryWithFederateInSingleAndShardingTable(true);
}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/env/EnvironmentPath.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/env/EnvironmentPath.java
index 32fe23b..8607c0b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/env/EnvironmentPath.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/env/EnvironmentPath.java
@@ -76,6 +76,18 @@ public final class EnvironmentPath {
}
/**
+ * Get init SQL file.
+ *
+ * @param databaseType database type
+ * @param scenario scenario
+ * @param fileName file name
+ * @return init SQL file
+ */
+ public static String getInitSQLFile(final DatabaseType databaseType, final String scenario, final String fileName) {
+ return getFile(databaseType, scenario, fileName);
+ }
+
+ /**
* Get data set file.
*
* @param scenario scenario
@@ -113,9 +125,25 @@ public final class EnvironmentPath {
}
private static String getFile(final DatabaseType databaseType, final String scenario, final String fileName) {
- String path = String.join("/", ROOT_PATH, scenario, "init-sql", databaseType.getName().toLowerCase(), fileName);
+ String path = getPath(databaseType, scenario, fileName);
URL url = EnvironmentPath.class.getClassLoader().getResource(path);
assertNotNull(String.format("File `%s` must exist.", path), url);
return url.getFile();
}
+
+ private static String getPath(final DatabaseType databaseType, final String scenario, final String fileName) {
+ return String.join("/", ROOT_PATH, scenario, "init-sql", databaseType.getName().toLowerCase(), fileName);
+ }
+
+ /**
+ * check SQL file exist.
+ *
+ * @param databaseType database type
+ * @param scenario scenario
+ * @param fileName file name
+ * @return weather SQL file exist or not
+ */
+ public static boolean checkSQLFileExist(final DatabaseType databaseType, final String scenario, final String fileName) {
+ return null != EnvironmentPath.class.getClassLoader().getResource(getPath(databaseType, scenario, fileName));
+ }
}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/container/storage/impl/H2Container.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/container/storage/impl/H2Container.java
index f4eeffc..6d707e8 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/container/storage/impl/H2Container.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/junit/container/storage/impl/H2Container.java
@@ -44,16 +44,27 @@ public final class H2Container extends ShardingSphereStorageContainer {
@SneakyThrows
protected void execute() {
super.execute();
- // TODO initialize SQL script
File file = new File(EnvironmentPath.getInitSQLFile(getDatabaseType(), getParameterizedArray().getScenario()));
for (Map.Entry<String, DataSource> each : getDataSourceMap().entrySet()) {
- try (Connection connection = each.getValue().getConnection();
- FileReader reader = new FileReader(file)) {
+ String databaseFileName = "init-" + each.getKey() + ".sql";
+ boolean sqlFileExist = EnvironmentPath.checkSQLFileExist(getDatabaseType(), getParameterizedArray().getScenario(), databaseFileName);
+ try (Connection connection = each.getValue().getConnection(); FileReader reader = new FileReader(file)) {
RunScript.execute(connection, reader);
+ if (sqlFileExist) {
+ executeDatabaseFile(connection, databaseFileName);
+ }
}
}
}
+ @SneakyThrows
+ private void executeDatabaseFile(final Connection connection, final String databaseFileName) {
+ File databaseFile = new File(EnvironmentPath.getInitSQLFile(getDatabaseType(), getParameterizedArray().getScenario(), databaseFileName));
+ try (FileReader databaseFileReader = new FileReader(databaseFile)) {
+ RunScript.execute(connection, databaseFileReader);
+ }
+ }
+
@Override
public boolean isHealthy() {
return true;
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/db/select_across_single_tables_with_federate.xml
similarity index 66%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/db/select_across_single_tables_with_federate.xml
index ed7f0db..b6917a5 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/db/select_across_single_tables_with_federate.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
@@ -16,13 +15,15 @@
~ limitations under the License.
-->
-<configuration>
- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
- <logger name="org.apache.shardingsphere" level="warn" additivity="true">
- <appender-ref ref="console" />
- </logger>
-</configuration>
+<dataset>
+ <metadata>
+ <column name="order_id" />
+ <column name="user_id" />
+ <column name="status" />
+ <column name="item_id" />
+ <column name="order_id0" />
+ <column name="user_id0" />
+ <column name="status0" />
+ </metadata>
+ <row values="1000, 10, init, 100000, 1000, 10, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/dbtbl_with_readwrite_splitting/select_across_single_tables_with_federate.xml
similarity index 66%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/dbtbl_with_readwrite_splitting/select_across_single_tables_with_federate.xml
index ed7f0db..b6917a5 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/dbtbl_with_readwrite_splitting/select_across_single_tables_with_federate.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
@@ -16,13 +15,15 @@
~ limitations under the License.
-->
-<configuration>
- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
- <logger name="org.apache.shardingsphere" level="warn" additivity="true">
- <appender-ref ref="console" />
- </logger>
-</configuration>
+<dataset>
+ <metadata>
+ <column name="order_id" />
+ <column name="user_id" />
+ <column name="status" />
+ <column name="item_id" />
+ <column name="order_id0" />
+ <column name="user_id0" />
+ <column name="status0" />
+ </metadata>
+ <row values="1000, 10, init, 100000, 1000, 10, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/select_across_single_tables_with_federate.xml
similarity index 66%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/select_across_single_tables_with_federate.xml
index ed7f0db..b6917a5 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/select_across_single_tables_with_federate.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
@@ -16,13 +15,15 @@
~ limitations under the License.
-->
-<configuration>
- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
- <logger name="org.apache.shardingsphere" level="warn" additivity="true">
- <appender-ref ref="console" />
- </logger>
-</configuration>
+<dataset>
+ <metadata>
+ <column name="order_id" />
+ <column name="user_id" />
+ <column name="status" />
+ <column name="item_id" />
+ <column name="order_id0" />
+ <column name="user_id0" />
+ <column name="status0" />
+ </metadata>
+ <row values="1000, 10, init, 100000, 1000, 10, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dql-integration-test-cases.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dql-integration-test-cases.xml
index 3ae34a0..5b220fd 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dql-integration-test-cases.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dql-integration-test-cases.xml
@@ -531,4 +531,8 @@
<!-- <test-case sql="SELECT * FROM t_single_table s INNER JOIN t_user o ON s.id = o.user_id" db-types="MySQL,Oracle,SQLServer" scenario-types="encrypt,dbtbl_with_readwrite_splitting_and_encrypt">-->
<!-- <assertion expected-data-file="select_from_single_join_order.xml"/>-->
<!-- </test-case>-->
+
+ <test-case sql="SELECT o.*, i.* FROM t_order_federate o, t_order_item_federate i WHERE o.order_id = ? AND i.item_id = ?" scenario-types="db,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt">
+ <assertion parameters="1000:int, 100000:int" expected-data-file="select_across_single_tables_with_federate.xml" />
+ </test-case>
</integration-test-cases>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/dataset.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/dataset.xml
index 0b439dc..600d1cc 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/dataset.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/dataset.xml
@@ -37,6 +37,17 @@
<column name="id" type="numeric" />
<column name="status" type="varchar" />
</metadata>
+ <metadata data-nodes="db_0.t_order_federate">
+ <column name="order_id" type="numeric" />
+ <column name="user_id" type="numeric" />
+ <column name="status" type="varchar" />
+ </metadata>
+ <metadata data-nodes="db_1.t_order_item_federate">
+ <column name="item_id" type="numeric" />
+ <column name="order_id" type="numeric" />
+ <column name="user_id" type="numeric" />
+ <column name="status" type="varchar" />
+ </metadata>
<row data-node="db_0.t_single_table" values="1, 1000, init" />
<row data-node="db_0.t_single_table" values="2, 1101, init" />
<row data-node="db_0.t_single_table" values="3, 2300, init" />
@@ -171,4 +182,10 @@
<row data-node="db_7.t_broadcast_table" values="1, init" />
<row data-node="db_8.t_broadcast_table" values="1, init" />
<row data-node="db_9.t_broadcast_table" values="1, init" />
+ <row data-node="db_0.t_order_federate" values="1000, 10, init" />
+ <row data-node="db_0.t_order_federate" values="1001, 11, init" />
+ <row data-node="db_1.t_order_item_federate" values="100000, 1000, 10, init" />
+ <row data-node="db_1.t_order_item_federate" values="100001, 1000, 10, init" />
+ <row data-node="db_1.t_order_item_federate" values="100100, 1001, 10, init" />
+ <row data-node="db_1.t_order_item_federate" values="100101, 1001, 10, init" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/h2/init-db_0.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/h2/init-db_0.sql
new file mode 100644
index 0000000..4abe2db
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/h2/init-db_0.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_federate;
+
+CREATE TABLE t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/h2/init-db_1.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/h2/init-db_1.sql
new file mode 100644
index 0000000..25dda09
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/h2/init-db_1.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_item_federate;
+
+CREATE TABLE t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/mysql/init.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/mysql/init.sql
index 8c8c4d8..35d2459 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/mysql/init.sql
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/mysql/init.sql
@@ -47,11 +47,13 @@ CREATE TABLE db_0.t_order (order_id INT NOT NULL, user_id INT NOT NULL, status V
CREATE TABLE db_0.t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE db_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
CREATE TABLE db_0.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE db_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX order_index_t_order ON db_0.t_order (order_id);
CREATE TABLE db_1.t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE db_1.t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE db_1.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE db_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX order_index_t_order ON db_1.t_order (order_id);
CREATE TABLE db_2.t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/oracle/init.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/oracle/init.sql
index e12e022..1c76c15 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/oracle/init.sql
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/oracle/init.sql
@@ -44,11 +44,13 @@ CREATE TABLE db_0.t_order (order_id INT NOT NULL, user_id INT NOT NULL, status V
CREATE TABLE db_0.t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE db_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
CREATE TABLE db_0.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE db_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX order_index_t_order ON db_0.t_order (order_id);
CREATE TABLE db_1.t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE db_1.t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE db_1.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE db_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX order_index_t_order ON db_1.t_order (order_id);
CREATE TABLE db_2.t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/sqlserver/init.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/sqlserver/init.sql
index 15778cb..8067df1 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/sqlserver/init.sql
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/db/init-sql/sqlserver/init.sql
@@ -44,11 +44,13 @@ CREATE TABLE db_0.t_order (order_id INT NOT NULL, user_id INT NOT NULL, status V
CREATE TABLE db_0.t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE db_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
CREATE TABLE db_0.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE db_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX order_index_t_order ON db_0.t_order (order_id);
CREATE TABLE db_1.t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE db_1.t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE db_1.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE db_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX order_index_t_order ON db_1.t_order (order_id);
CREATE TABLE db_2.t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/dataset.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/dataset.xml
index 84bbff4..bfa9b5d 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/dataset.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/dataset.xml
@@ -37,6 +37,17 @@
<column name="id" type="numeric" />
<column name="status" type="varchar" />
</metadata>
+ <metadata data-nodes="write_ds_0.t_order_federate,read_ds_0.t_order_federate">
+ <column name="order_id" type="numeric" />
+ <column name="user_id" type="numeric" />
+ <column name="status" type="varchar" />
+ </metadata>
+ <metadata data-nodes="write_ds_1.t_order_item_federate,read_ds_1.t_order_item_federate">
+ <column name="item_id" type="numeric" />
+ <column name="order_id" type="numeric" />
+ <column name="user_id" type="numeric" />
+ <column name="status" type="varchar" />
+ </metadata>
<row data-node="write_ds_0.t_single_table" values="1, 1000, init" />
<row data-node="write_ds_0.t_single_table" values="2, 1101, init" />
<row data-node="write_ds_0.t_single_table" values="3, 1202, init" />
@@ -351,6 +362,12 @@
<row data-node="write_ds_7.t_broadcast_table" values="1, init" />
<row data-node="write_ds_8.t_broadcast_table" values="1, init" />
<row data-node="write_ds_9.t_broadcast_table" values="1, init" />
+ <row data-node="write_ds_0.t_order_federate" values="1000, 10, init" />
+ <row data-node="write_ds_0.t_order_federate" values="1001, 11, init" />
+ <row data-node="write_ds_1.t_order_item_federate" values="100000, 1000, 10, init" />
+ <row data-node="write_ds_1.t_order_item_federate" values="100001, 1000, 10, init" />
+ <row data-node="write_ds_1.t_order_item_federate" values="100100, 1001, 10, init" />
+ <row data-node="write_ds_1.t_order_item_federate" values="100101, 1001, 10, init" />
<row data-node="read_ds_0.t_single_table" values="1, 1000, init_read" />
<row data-node="read_ds_0.t_single_table" values="2, 1101, init_read" />
<row data-node="read_ds_0.t_single_table" values="3, 1202, init_read" />
@@ -665,4 +682,10 @@
<row data-node="read_ds_7.t_broadcast_table" values="1, init_read" />
<row data-node="read_ds_8.t_broadcast_table" values="1, init_read" />
<row data-node="read_ds_9.t_broadcast_table" values="1, init_read" />
+ <row data-node="read_ds_0.t_order_federate" values="1000, 10, init" />
+ <row data-node="read_ds_0.t_order_federate" values="1001, 11, init" />
+ <row data-node="read_ds_1.t_order_item_federate" values="100000, 1000, 10, init" />
+ <row data-node="read_ds_1.t_order_item_federate" values="100001, 1000, 10, init" />
+ <row data-node="read_ds_1.t_order_item_federate" values="100100, 1001, 10, init" />
+ <row data-node="read_ds_1.t_order_item_federate" values="100101, 1001, 10, init" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-read_ds_0.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-read_ds_0.sql
new file mode 100644
index 0000000..4abe2db
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-read_ds_0.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_federate;
+
+CREATE TABLE t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-read_ds_1.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-read_ds_1.sql
new file mode 100644
index 0000000..25dda09
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-read_ds_1.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_item_federate;
+
+CREATE TABLE t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-write_ds_0.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-write_ds_0.sql
new file mode 100644
index 0000000..4abe2db
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-write_ds_0.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_federate;
+
+CREATE TABLE t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-write_ds_1.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-write_ds_1.sql
new file mode 100644
index 0000000..25dda09
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/h2/init-write_ds_1.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_item_federate;
+
+CREATE TABLE t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/mysql/init.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/mysql/init.sql
index 53c6486..0a64048 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/mysql/init.sql
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/mysql/init.sql
@@ -85,6 +85,7 @@ CREATE TABLE write_ds_0.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL,
CREATE TABLE write_ds_0.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE write_ds_0.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
CREATE TABLE write_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+CREATE TABLE write_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX order_index_t_order_0 ON write_ds_0.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON write_ds_0.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON write_ds_0.t_order_2 (order_id);
@@ -117,6 +118,7 @@ CREATE TABLE write_ds_1.t_order_item_8 (item_id INT NOT NULL, order_id INT NOT N
CREATE TABLE write_ds_1.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE write_ds_1.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE write_ds_1.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE write_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX order_index_t_order_0 ON write_ds_1.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON write_ds_1.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON write_ds_1.t_order_2 (order_id);
@@ -406,6 +408,7 @@ CREATE TABLE read_ds_0.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL, s
CREATE TABLE read_ds_0.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE read_ds_0.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
CREATE TABLE read_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+CREATE TABLE read_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX order_index_t_order_0 ON read_ds_0.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON read_ds_0.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON read_ds_0.t_order_2 (order_id);
@@ -438,6 +441,7 @@ CREATE TABLE read_ds_1.t_order_item_8 (item_id INT NOT NULL, order_id INT NOT NU
CREATE TABLE read_ds_1.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE read_ds_1.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE read_ds_1.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE read_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX order_index_t_order_0 ON read_ds_1.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON read_ds_1.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON read_ds_1.t_order_2 (order_id);
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/oracle/init.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/oracle/init.sql
index 2bcb7af..f1bb14d 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/oracle/init.sql
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/oracle/init.sql
@@ -82,6 +82,7 @@ CREATE TABLE write_ds_0.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL,
CREATE TABLE write_ds_0.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE write_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
CREATE TABLE write_ds_0.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE write_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX order_index_t_order_0 ON write_ds_0.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON write_ds_0.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON write_ds_0.t_order_2 (order_id);
@@ -114,6 +115,7 @@ CREATE TABLE write_ds_1.t_order_item_8 (item_id INT NOT NULL, order_id INT NOT N
CREATE TABLE write_ds_1.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE write_ds_1.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE write_ds_1.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE write_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX order_index_t_order_0 ON write_ds_1.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON write_ds_1.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON write_ds_1.t_order_2 (order_id);
@@ -403,6 +405,7 @@ CREATE TABLE read_ds_0.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL, s
CREATE TABLE read_ds_0.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE read_ds_0.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
CREATE TABLE read_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+CREATE TABLE read_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX order_index_t_order_0 ON read_ds_0.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON read_ds_0.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON read_ds_0.t_order_2 (order_id);
@@ -435,6 +438,7 @@ CREATE TABLE read_ds_1.t_order_item_8 (item_id INT NOT NULL, order_id INT NOT NU
CREATE TABLE read_ds_1.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE read_ds_1.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE read_ds_1.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE read_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX order_index_t_order_0 ON read_ds_1.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON read_ds_1.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON read_ds_1.t_order_2 (order_id);
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/sqlserver/init.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/sqlserver/init.sql
index d9e2582..0e47134 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/sqlserver/init.sql
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting/init-sql/sqlserver/init.sql
@@ -82,6 +82,7 @@ CREATE TABLE write_ds_0.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL,
CREATE TABLE write_ds_0.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE write_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
CREATE TABLE write_ds_0.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE write_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX order_index_t_order_0 ON write_ds_0.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON write_ds_0.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON write_ds_0.t_order_2 (order_id);
@@ -114,6 +115,7 @@ CREATE TABLE write_ds_1.t_order_item_8 (item_id INT NOT NULL, order_id INT NOT N
CREATE TABLE write_ds_1.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE write_ds_1.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE write_ds_1.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE write_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX order_index_t_order_0 ON write_ds_1.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON write_ds_1.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON write_ds_1.t_order_2 (order_id);
@@ -403,6 +405,7 @@ CREATE TABLE read_ds_0.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL, s
CREATE TABLE read_ds_0.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE read_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
CREATE TABLE read_ds_0.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE read_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX order_index_t_order_0 ON read_ds_0.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON read_ds_0.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON read_ds_0.t_order_2 (order_id);
@@ -435,6 +438,7 @@ CREATE TABLE read_ds_1.t_order_item_8 (item_id INT NOT NULL, order_id INT NOT NU
CREATE TABLE read_ds_1.t_order_9 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE read_ds_1.t_order_item_9 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE read_ds_1.t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
+CREATE TABLE read_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX order_index_t_order_0 ON read_ds_1.t_order_0 (order_id);
CREATE INDEX order_index_t_order_1 ON read_ds_1.t_order_1 (order_id);
CREATE INDEX order_index_t_order_2 ON read_ds_1.t_order_2 (order_id);
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/dataset.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/dataset.xml
index 8e0e288..2b70f61 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/dataset.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/dataset.xml
@@ -34,6 +34,17 @@
<column name="id" type="numeric" />
<column name="status" type="varchar" />
</metadata>
+ <metadata data-nodes="encrypt_write_ds_0.t_order_federate,encrypt_read_ds_0.t_order_federate">
+ <column name="order_id" type="numeric" />
+ <column name="user_id" type="numeric" />
+ <column name="status" type="varchar" />
+ </metadata>
+ <metadata data-nodes="encrypt_write_ds_1.t_order_item_federate,encrypt_read_ds_1.t_order_item_federate">
+ <column name="item_id" type="numeric" />
+ <column name="order_id" type="numeric" />
+ <column name="user_id" type="numeric" />
+ <column name="status" type="varchar" />
+ </metadata>
<row data-node="encrypt_write_ds_0.t_single_table" values="1, 0, init" />
<row data-node="encrypt_write_ds_0.t_single_table" values="2, 11, init" />
<row data-node="encrypt_write_ds_0.t_single_table" values="3, 22, init" />
@@ -238,6 +249,12 @@
<row data-node="encrypt_write_ds_9.t_user_item_7" values="190007, 79, init, 2017-08-08" />
<row data-node="encrypt_write_ds_9.t_user_item_8" values="190008, 89, init, 2017-08-08" />
<row data-node="encrypt_write_ds_9.t_user_item_9" values="190009, 99, init, 2017-08-08" />
+ <row data-node="encrypt_write_ds_0.t_order_federate" values="1000, 10, init" />
+ <row data-node="encrypt_write_ds_0.t_order_federate" values="1001, 11, init" />
+ <row data-node="encrypt_write_ds_1.t_order_item_federate" values="100000, 1000, 10, init" />
+ <row data-node="encrypt_write_ds_1.t_order_item_federate" values="100001, 1000, 10, init" />
+ <row data-node="encrypt_write_ds_1.t_order_item_federate" values="100100, 1001, 10, init" />
+ <row data-node="encrypt_write_ds_1.t_order_item_federate" values="100101, 1001, 10, init" />
<row data-node="encrypt_read_ds_0.t_single_table" values="1, 0, init_read" />
<row data-node="encrypt_read_ds_0.t_single_table" values="2, 11, init_read" />
<row data-node="encrypt_read_ds_0.t_single_table" values="3, 22, init_read" />
@@ -442,4 +459,10 @@
<row data-node="encrypt_read_ds_9.t_user_item_7" values="190007, 79, init_read, 2017-08-08" />
<row data-node="encrypt_read_ds_9.t_user_item_8" values="190008, 89, init_read, 2017-08-08" />
<row data-node="encrypt_read_ds_9.t_user_item_9" values="190009, 99, init_read, 2017-08-08" />
+ <row data-node="encrypt_read_ds_0.t_order_federate" values="1000, 10, init" />
+ <row data-node="encrypt_read_ds_0.t_order_federate" values="1001, 11, init" />
+ <row data-node="encrypt_read_ds_1.t_order_item_federate" values="100000, 1000, 10, init" />
+ <row data-node="encrypt_read_ds_1.t_order_item_federate" values="100001, 1000, 10, init" />
+ <row data-node="encrypt_read_ds_1.t_order_item_federate" values="100100, 1001, 10, init" />
+ <row data-node="encrypt_read_ds_1.t_order_item_federate" values="100101, 1001, 10, init" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_read_ds_0.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_read_ds_0.sql
new file mode 100644
index 0000000..4abe2db
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_read_ds_0.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_federate;
+
+CREATE TABLE t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_read_ds_1.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_read_ds_1.sql
new file mode 100644
index 0000000..25dda09
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_read_ds_1.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_item_federate;
+
+CREATE TABLE t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_write_ds_0.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_write_ds_0.sql
new file mode 100644
index 0000000..4abe2db
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_write_ds_0.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_federate;
+
+CREATE TABLE t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_write_ds_1.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_write_ds_1.sql
new file mode 100644
index 0000000..25dda09
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/h2/init-encrypt_write_ds_1.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DROP TABLE IF EXISTS t_order_item_federate;
+
+CREATE TABLE t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/mysql/init.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/mysql/init.sql
index be5a1de..d585aae 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/mysql/init.sql
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/mysql/init.sql
@@ -84,6 +84,7 @@ CREATE TABLE encrypt_write_ds_0.t_user_item_8 (item_id INT NOT NULL, user_id INT
CREATE TABLE encrypt_write_ds_0.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_write_ds_0.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_write_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+CREATE TABLE encrypt_write_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX user_index_t_user_0 ON encrypt_write_ds_0.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_write_ds_0.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_write_ds_0.t_user_2 (user_id);
@@ -115,6 +116,7 @@ CREATE TABLE encrypt_write_ds_1.t_user_8 (user_id INT NOT NULL, address_id INT N
CREATE TABLE encrypt_write_ds_1.t_user_item_8 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_write_ds_1.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_write_ds_1.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
+CREATE TABLE encrypt_write_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX user_index_t_user_0 ON encrypt_write_ds_1.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_write_ds_1.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_write_ds_1.t_user_2 (user_id);
@@ -395,6 +397,7 @@ CREATE TABLE encrypt_read_ds_0.t_user_item_8 (item_id INT NOT NULL, user_id INT
CREATE TABLE encrypt_read_ds_0.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_read_ds_0.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_read_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+CREATE TABLE encrypt_read_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX user_index_t_user_0 ON encrypt_read_ds_0.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_read_ds_0.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_read_ds_0.t_user_2 (user_id);
@@ -426,6 +429,7 @@ CREATE TABLE encrypt_read_ds_1.t_user_8 (user_id INT NOT NULL, address_id INT NO
CREATE TABLE encrypt_read_ds_1.t_user_item_8 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_read_ds_1.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_read_ds_1.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
+CREATE TABLE encrypt_read_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX user_index_t_user_0 ON encrypt_read_ds_1.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_read_ds_1.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_read_ds_1.t_user_2 (user_id);
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/oracle/init.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/oracle/init.sql
index 5f5281c..3789f48 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/oracle/init.sql
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/oracle/init.sql
@@ -81,6 +81,7 @@ CREATE TABLE encrypt_write_ds_0.t_user_item_8 (item_id INT NOT NULL, user_id INT
CREATE TABLE encrypt_write_ds_0.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_write_ds_0.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_write_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+CREATE TABLE encrypt_write_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX user_index_t_user_0 ON encrypt_write_ds_0.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_write_ds_0.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_write_ds_0.t_user_2 (user_id);
@@ -112,6 +113,7 @@ CREATE TABLE encrypt_write_ds_1.t_user_8 (user_id INT NOT NULL, address_id INT N
CREATE TABLE encrypt_write_ds_1.t_user_item_8 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_write_ds_1.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_write_ds_1.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
+CREATE TABLE encrypt_write_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX user_index_t_user_0 ON encrypt_write_ds_1.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_write_ds_1.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_write_ds_1.t_user_2 (user_id);
@@ -392,6 +394,7 @@ CREATE TABLE encrypt_read_ds_0.t_user_item_8 (item_id INT NOT NULL, user_id INT
CREATE TABLE encrypt_read_ds_0.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_read_ds_0.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_read_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+CREATE TABLE encrypt_read_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX user_index_t_user_0 ON encrypt_read_ds_0.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_read_ds_0.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_read_ds_0.t_user_2 (user_id);
@@ -423,6 +426,7 @@ CREATE TABLE encrypt_read_ds_1.t_user_8 (user_id INT NOT NULL, address_id INT NO
CREATE TABLE encrypt_read_ds_1.t_user_item_8 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_read_ds_1.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_read_ds_1.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
+CREATE TABLE encrypt_read_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX user_index_t_user_0 ON encrypt_read_ds_1.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_read_ds_1.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_read_ds_1.t_user_2 (user_id);
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/sqlserver/init.sql b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/sqlserver/init.sql
index 901b35b..5bbc0b3 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/sqlserver/init.sql
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/dbtbl_with_readwrite_splitting_and_encrypt/init-sql/sqlserver/init.sql
@@ -81,6 +81,7 @@ CREATE TABLE encrypt_write_ds_0.t_user_item_8 (item_id INT NOT NULL, user_id INT
CREATE TABLE encrypt_write_ds_0.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_write_ds_0.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_write_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+CREATE TABLE encrypt_write_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX user_index_t_user_0 ON encrypt_write_ds_0.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_write_ds_0.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_write_ds_0.t_user_2 (user_id);
@@ -112,6 +113,7 @@ CREATE TABLE encrypt_write_ds_1.t_user_8 (user_id INT NOT NULL, address_id INT N
CREATE TABLE encrypt_write_ds_1.t_user_item_8 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_write_ds_1.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_write_ds_1.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
+CREATE TABLE encrypt_write_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX user_index_t_user_0 ON encrypt_write_ds_1.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_write_ds_1.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_write_ds_1.t_user_2 (user_id);
@@ -392,6 +394,7 @@ CREATE TABLE encrypt_read_ds_0.t_user_item_8 (item_id INT NOT NULL, user_id INT
CREATE TABLE encrypt_read_ds_0.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_read_ds_0.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_read_ds_0.t_single_table (single_id INT NOT NULL, id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (single_id));
+CREATE TABLE encrypt_read_ds_0.t_order_federate (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE INDEX user_index_t_user_0 ON encrypt_read_ds_0.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_read_ds_0.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_read_ds_0.t_user_2 (user_id);
@@ -423,6 +426,7 @@ CREATE TABLE encrypt_read_ds_1.t_user_8 (user_id INT NOT NULL, address_id INT NO
CREATE TABLE encrypt_read_ds_1.t_user_item_8 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
CREATE TABLE encrypt_read_ds_1.t_user_9 (user_id INT NOT NULL, address_id INT NOT NULL, pwd_plain VARCHAR(45) NULL, pwd_cipher VARCHAR(45) NULL, status VARCHAR(45) NULL, PRIMARY KEY (user_id));
CREATE TABLE encrypt_read_ds_1.t_user_item_9 (item_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
+CREATE TABLE encrypt_read_ds_1.t_order_item_federate (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id));
CREATE INDEX user_index_t_user_0 ON encrypt_read_ds_1.t_user_0 (user_id);
CREATE INDEX user_index_t_user_1 ON encrypt_read_ds_1.t_user_1 (user_id);
CREATE INDEX user_index_t_user_2 ON encrypt_read_ds_1.t_user_2 (user_id);
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml
index ed7f0db..3cec2ca 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/logback-test.xml
@@ -25,4 +25,8 @@
<logger name="org.apache.shardingsphere" level="warn" additivity="true">
<appender-ref ref="console" />
</logger>
+ <root>
+ <level value="error" />
+ <appender-ref ref="console" />
+ </root>
</configuration>