You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/11/18 05:58:42 UTC
[shardingsphere] branch master updated: Add RAL REFRESH DATABASE METADATA FROM GOVERNANCE CENTER IT (#22247)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new bb2e6b8dbb0 Add RAL REFRESH DATABASE METADATA FROM GOVERNANCE CENTER IT (#22247)
bb2e6b8dbb0 is described below
commit bb2e6b8dbb0a4c9e9048a4ab8a8f1ce889359b01
Author: zhaojinchao <zh...@apache.org>
AuthorDate: Fri Nov 18 13:58:34 2022 +0800
Add RAL REFRESH DATABASE METADATA FROM GOVERNANCE CENTER IT (#22247)
* Add RAL REFRESH DATABASE METADATA FROM GOVERNANCE CENTER IT
* Fix it
* Fix ci
* Fix ci
* Remove sleep
---
.../test/integration/engine/ral/GeneralRALIT.java | 20 ++++++--
.../cases/ddl/ddl-integration-test-cases.xml | 8 +---
.../dataset/empty_rules/mysql/show_resources.xml | 54 ++++++++++++++++++++++
.../empty_rules/opengauss/show_resources.xml | 54 ++++++++++++++++++++++
.../empty_rules/postgresql/show_resources.xml | 54 ++++++++++++++++++++++
.../empty_rules/show_sharding_table_rule.xml | 39 ++++++++++++++++
.../cases/ral/dataset/empty_rules/show_tables.xml | 26 +++++++++++
.../cases/ral/ral-integration-test-cases.xml | 14 +++++-
8 files changed, 259 insertions(+), 10 deletions(-)
diff --git a/test/integration-test/test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ral/GeneralRALIT.java b/test/integration-test/test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ral/GeneralRALIT.java
index 08d2da449c8..4165a86d23f 100644
--- a/test/integration-test/test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ral/GeneralRALIT.java
+++ b/test/integration-test/test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ral/GeneralRALIT.java
@@ -48,10 +48,24 @@ public final class GeneralRALIT extends BaseRALIT {
public void assertExecute() throws SQLException, ParseException {
try (Connection connection = getTargetDataSource().getConnection()) {
try (
- Statement statement = connection.createStatement();
- ResultSet resultSet = statement.executeQuery(getSQL())) {
- assertResultSet(resultSet);
+ Statement statement = connection.createStatement()) {
+ assertResultSet(statement);
}
}
}
+
+ private void assertResultSet(final Statement statement) throws SQLException, ParseException {
+ if (null == getAssertion().getAssertionSQL()) {
+ assertResultSet(statement, getSQL());
+ } else {
+ statement.execute(getSQL());
+ assertResultSet(statement, getAssertion().getAssertionSQL().getSql());
+ }
+ }
+
+ private void assertResultSet(final Statement statement, final String sql) throws SQLException {
+ try (ResultSet resultSet = statement.executeQuery(sql)) {
+ assertResultSet(resultSet);
+ }
+ }
}
diff --git a/test/integration-test/test-suite/src/test/resources/cases/ddl/ddl-integration-test-cases.xml b/test/integration-test/test-suite/src/test/resources/cases/ddl/ddl-integration-test-cases.xml
index 8905f7ad3e8..b9072ef2a79 100644
--- a/test/integration-test/test-suite/src/test/resources/cases/ddl/ddl-integration-test-cases.xml
+++ b/test/integration-test/test-suite/src/test/resources/cases/ddl/ddl-integration-test-cases.xml
@@ -63,7 +63,7 @@
<initial-sql sql="CREATE TABLE t_order_details(id int, description varchar(10))" affected-table="t_order_details" />
</assertion>
</test-case>
-
+
<!-- TODO Fix me #20932 -->
<!-- <test-case sql="DROP INDEX t_order_details_index ON t_order_details" db-types="MySQL,SQLServer,Oracle" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting,sharding_governance">-->
<!-- <assertion expected-data-file="unchanged_table.xml">-->
@@ -107,7 +107,6 @@
</assertion>
</test-case>
- <!-- TODO Fix me #20932 -->
<test-case sql="ALTER TABLE t_broadcast_table_for_ddl ADD name varchar(10)" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting">
<assertion expected-data-file="alter_broadcast_add.xml">
<initial-sql sql="CREATE TABLE t_broadcast_table_for_ddl(id int, description varchar(10))" affected-table="t_broadcast_table_for_ddl" />
@@ -137,8 +136,7 @@
<initial-sql sql="CREATE TABLE t_broadcast_table_for_ddl(id int, description varchar(10))" affected-table="t_broadcast_table_for_ddl" />
</assertion>
</test-case>
-
- <!-- TODO Fix me #20932 -->
+
<test-case sql="DROP INDEX t_broadcast_table_for_ddl_index ON t_broadcast_table_for_ddl" db-types="MySQL,SQLServer,Oracle" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting">
<assertion expected-data-file="unchanged_broadcast_table.xml">
<initial-sql sql="CREATE TABLE t_broadcast_table_for_ddl(id int, description varchar(10));CREATE INDEX t_broadcast_table_for_ddl_index ON t_broadcast_table_for_ddl(description)" affected-table="t_broadcast_table_for_ddl" />
@@ -223,14 +221,12 @@
</assertion>
</test-case>
- <!-- TODO Fix me #20932 -->
<test-case sql="DROP INDEX t_user_details_index on t_user_details" db-types="MySQL,SQLServer,Oracle" scenario-types="encrypt,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt,encrypt_and_readwrite_splitting">
<assertion expected-data-file="unchanged_table.xml">
<initial-sql sql="CREATE TABLE t_user_details (user_id INT NOT NULL, address_id INT NOT NULL, number_plain VARCHAR(45) NULL, number_cipher VARCHAR(45) NULL, description varchar(10));CREATE INDEX t_user_details_index ON t_user_details(description)" affected-table="t_user_details" />
</assertion>
</test-case>
- <!-- TODO Fix me #20932 -->
<test-case sql="DROP INDEX t_user_details_index" db-types="PostgreSQL" scenario-types="encrypt,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt,encrypt_and_readwrite_splitting">
<assertion expected-data-file="unchanged_table.xml">
<initial-sql sql="CREATE TABLE t_user_details (user_id INT NOT NULL, address_id INT NOT NULL, number_plain VARCHAR(45) NULL, number_cipher VARCHAR(45) NULL, description varchar(10));CREATE INDEX t_user_details_index ON t_user_details(description)" affected-table="t_user_details" />
diff --git a/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/mysql/show_resources.xml b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/mysql/show_resources.xml
new file mode 100644
index 00000000000..ad817841422
--- /dev/null
+++ b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/mysql/show_resources.xml
@@ -0,0 +1,54 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="connection_timeout_milliseconds" />
+ <column name="idle_timeout_milliseconds" />
+ <column name="max_lifetime_milliseconds" />
+ <column name="max_pool_size" />
+ <column name="min_pool_size" />
+ <column name="read_only" />
+ <column name="other_attributes" />
+ </metadata>
+ <row values="write_ds_0| MySQL| mysql.empty_rules.host| 3306| write_ds_0| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="write_ds_1| MySQL| mysql.empty_rules.host| 3306| write_ds_1| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="write_ds_2| MySQL| mysql.empty_rules.host| 3306| write_ds_2| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="write_ds_3| MySQL| mysql.empty_rules.host| 3306| write_ds_3| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="write_ds_4| MySQL| mysql.empty_rules.host| 3306| write_ds_4| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="write_ds_5| MySQL| mysql.empty_rules.host| 3306| write_ds_5| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="write_ds_6| MySQL| mysql.empty_rules.host| 3306| write_ds_6| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="write_ds_7| MySQL| mysql.empty_rules.host| 3306| write_ds_7| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="write_ds_8| MySQL| mysql.empty_rules.host| 3306| write_ds_8| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="write_ds_9| MySQL| mysql.empty_rules.host| 3306| write_ds_9| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+ <row values="read_ds_0| MySQL| mysql.empty_rules.host| 3306| read_ds_0| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="read_ds_1| MySQL| mysql.empty_rules.host| 3306| read_ds_1| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="read_ds_2| MySQL| mysql.empty_rules.host| 3306| read_ds_2| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="read_ds_3| MySQL| mysql.empty_rules.host| 3306| read_ds_3| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="read_ds_4| MySQL| mysql.empty_rules.host| 3306| read_ds_4| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="read_ds_5| MySQL| mysql.empty_rules.host| 3306| read_ds_5| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="read_ds_6| MySQL| mysql.empty_rules.host| 3306| read_ds_6| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="read_ds_7| MySQL| mysql.empty_rules.host| 3306| read_ds_7| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="read_ds_8| MySQL| mysql.empty_rules.host| 3306| read_ds_8| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="read_ds_9| MySQL| mysql.empty_rules.host| 3306| read_ds_9| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":&qu [...]
+ <row values="rdl_test_0| MySQL| mysql.empty_rules.host| 3306| rdl_test_0| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":& [...]
+</dataset>
diff --git a/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/opengauss/show_resources.xml b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/opengauss/show_resources.xml
new file mode 100644
index 00000000000..7e70c30d3d2
--- /dev/null
+++ b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/opengauss/show_resources.xml
@@ -0,0 +1,54 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="connection_timeout_milliseconds" />
+ <column name="idle_timeout_milliseconds" />
+ <column name="max_lifetime_milliseconds" />
+ <column name="max_pool_size" />
+ <column name="min_pool_size" />
+ <column name="read_only" />
+ <column name="other_attributes" />
+ </metadata>
+ <row values="write_ds_0| openGauss| opengauss.empty_rules.host| 5432| write_ds_0| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="write_ds_1| openGauss| opengauss.empty_rules.host| 5432| write_ds_1| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="write_ds_2| openGauss| opengauss.empty_rules.host| 5432| write_ds_2| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="write_ds_3| openGauss| opengauss.empty_rules.host| 5432| write_ds_3| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="write_ds_4| openGauss| opengauss.empty_rules.host| 5432| write_ds_4| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="write_ds_5| openGauss| opengauss.empty_rules.host| 5432| write_ds_5| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="write_ds_6| openGauss| opengauss.empty_rules.host| 5432| write_ds_6| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="write_ds_7| openGauss| opengauss.empty_rules.host| 5432| write_ds_7| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="write_ds_8| openGauss| opengauss.empty_rules.host| 5432| write_ds_8| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="write_ds_9| openGauss| opengauss.empty_rules.host| 5432| write_ds_9| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_0| openGauss| opengauss.empty_rules.host| 5432| read_ds_0| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="read_ds_1| openGauss| opengauss.empty_rules.host| 5432| read_ds_1| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="read_ds_2| openGauss| opengauss.empty_rules.host| 5432| read_ds_2| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="read_ds_3| openGauss| opengauss.empty_rules.host| 5432| read_ds_3| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="read_ds_4| openGauss| opengauss.empty_rules.host| 5432| read_ds_4| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="read_ds_5| openGauss| opengauss.empty_rules.host| 5432| read_ds_5| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="read_ds_6| openGauss| opengauss.empty_rules.host| 5432| read_ds_6| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="read_ds_7| openGauss| opengauss.empty_rules.host| 5432| read_ds_7| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="read_ds_8| openGauss| opengauss.empty_rules.host| 5432| read_ds_8| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="read_ds_9| openGauss| opengauss.empty_rules.host| 5432| read_ds_9| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false [...]
+ <row values="rdl_test_0| openGauss| opengauss.empty_rules.host| 5432| rdl_test_0| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+</dataset>
diff --git a/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/postgresql/show_resources.xml b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/postgresql/show_resources.xml
new file mode 100644
index 00000000000..3d3e9c711b9
--- /dev/null
+++ b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/postgresql/show_resources.xml
@@ -0,0 +1,54 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="connection_timeout_milliseconds" />
+ <column name="idle_timeout_milliseconds" />
+ <column name="max_lifetime_milliseconds" />
+ <column name="max_pool_size" />
+ <column name="min_pool_size" />
+ <column name="read_only" />
+ <column name="other_attributes" />
+ </metadata>
+ <row values="write_ds_0| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_0| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="write_ds_1| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_1| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="write_ds_2| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_2| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="write_ds_3| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_3| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="write_ds_4| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_4| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="write_ds_5| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_5| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="write_ds_6| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_6| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="write_ds_7| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_7| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="write_ds_8| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_8| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="write_ds_9| PostgreSQL| postgresql.empty_rules.host| 5432| write_ds_9| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+ <row values="read_ds_0| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_0| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_1| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_1| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_2| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_2| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_3| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_3| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_4| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_4| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_5| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_5| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_6| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_6| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_7| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_7| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_8| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_8| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="read_ds_9| PostgreSQL| postgresql.empty_rules.host| 5432| read_ds_9| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":false& [...]
+ <row values="rdl_test_0| PostgreSQL| postgresql.empty_rules.host| 5432| rdl_test_0| 30000| 60000| 1800000| 2| 2| false| {"dataSourceProperties":{},"healthCheckProperties":{},"initializationFailTimeout":1,"validationTimeout":5000,"keepaliveTime":0,"leakDetectionThreshold":0,"registerMbeans":false,"allowPoolSuspension":fals [...]
+</dataset>
diff --git a/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/show_sharding_table_rule.xml b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/show_sharding_table_rule.xml
new file mode 100644
index 00000000000..ad8b0dbee29
--- /dev/null
+++ b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/show_sharding_table_rule.xml
@@ -0,0 +1,39 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="table" />
+ <column name="actual_data_nodes" />
+ <column name="actual_data_sources" />
+ <column name="database_strategy_type" />
+ <column name="database_sharding_column" />
+ <column name="database_sharding_algorithm_type" />
+ <column name="database_sharding_algorithm_props" />
+ <column name="table_strategy_type" />
+ <column name="table_sharding_column" />
+ <column name="table_sharding_algorithm_type" />
+ <column name="table_sharding_algorithm_props" />
+ <column name="key_generate_column" />
+ <column name="key_generator_type" />
+ <column name="key_generator_props" />
+ <column name="auditor_types" />
+ <column name="allow_hint_disable" />
+ </metadata>
+ <row values="t_user| | write_ds_${0..9}| | | | | STANDARD| user_id| MOD| sharding-count=40| user_id| IT.FIXTURE| | |" />
+ <row values="t_user_item| | write_ds_${0..9}| | | | |STANDARD| user_id| MOD| sharding-count=40| user_id| IT.FIXTURE| | |" />
+</dataset>
diff --git a/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/show_tables.xml b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/show_tables.xml
new file mode 100644
index 00000000000..d5553d0edff
--- /dev/null
+++ b/test/integration-test/test-suite/src/test/resources/cases/ral/dataset/empty_rules/show_tables.xml
@@ -0,0 +1,26 @@
+<!--
+ ~ 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.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="Tables_in_empty_rules" />
+ <column name="Table_type" />
+ </metadata>
+ <row values="t_single_table| BASE TABLE" />
+ <row values="t_user| BASE TABLE" />
+ <row values="t_user_item| BASE TABLE" />
+</dataset>
diff --git a/test/integration-test/test-suite/src/test/resources/cases/ral/ral-integration-test-cases.xml b/test/integration-test/test-suite/src/test/resources/cases/ral/ral-integration-test-cases.xml
index 7593a2c018e..68b238e7066 100644
--- a/test/integration-test/test-suite/src/test/resources/cases/ral/ral-integration-test-cases.xml
+++ b/test/integration-test/test-suite/src/test/resources/cases/ral/ral-integration-test-cases.xml
@@ -73,9 +73,21 @@
sql="PREVIEW SELECT * FROM t_single_table s INNER JOIN t_user_item i ON s.single_id = i.item_id WHERE i.user_id = 1">
<assertion expected-data-file="preview_federation_select.xml"/>
</test-case>
-
+
<test-case sql="SHOW COMPUTE NODES">
<assertion expected-data-file="show_compute_nodes.xml"/>
</test-case>
+
+ <test-case sql="REFRESH DATABASE METADATA FROM GOVERNANCE CENTER" db-types="MySQL">
+ <assertion expected-data-file="show_sharding_table_rule.xml">
+ <assertion-sql sql="SHOW SHARDING TABLE RULES" />
+ </assertion>
+ <assertion expected-data-file="show_resources.xml">
+ <assertion-sql sql="SHOW STORAGE UNITS" />
+ </assertion>
+ <assertion expected-data-file="show_tables.xml">
+ <assertion-sql sql="SHOW TABLES" />
+ </assertion>
+ </test-case>
</integration-test-cases>