This is an automated email from the ASF dual-hosted git repository.

jianglongtao 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 eaae54ab4a1 Remove COUNT DATABASE RULES (#21050)
eaae54ab4a1 is described below

commit eaae54ab4a1e05563ef2a7f1f82ecd9293973763
Author: skai <[email protected]>
AuthorDate: Tue Sep 20 23:57:28 2022 +0800

    Remove COUNT DATABASE RULES (#21050)
    
    * Remove `COUNT DATABASE RULES`
    
    * remove parser-test
    
    * remove integration-test
    
    * fix bug
    
    * remove doc
---
 .../distsql/syntax/ral/_index.cn.md                |   1 -
 .../distsql/syntax/ral/_index.en.md                |   1 -
 .../src/main/antlr4/imports/RQLStatement.g4        |   4 -
 .../parser/autogen/KernelDistSQLStatement.g4       |   1 -
 .../core/kernel/KernelDistSQLStatementVisitor.java |   7 -
 .../rql/show/CountDatabaseRulesStatement.java      |  30 ----
 .../rql/rule/DatabaseRulesCountResultSet.java      | 160 -----------------
 ...dingsphere.infra.distsql.query.DistSQLResultSet |   1 -
 .../rql/DatabaseRulesCountResultSetTest.java       | 193 ---------------------
 .../cases/rql/dataset/db/count_database_rules.xml  |  31 ----
 .../cases/rql/rql-integration-test-cases.xml       |   4 -
 .../distsql/rql/impl/ShowRulesStatementAssert.java |   5 -
 .../rule/CountDatabaseRulesStatementAssert.java    |  51 ------
 .../jaxb/cases/domain/SQLParserTestCases.java      |   4 -
 .../rql/CountDatabaseRulesStatementTestCase.java   |  36 ----
 .../src/main/resources/case/rql/show.xml           |   4 -
 .../src/main/resources/sql/supported/rql/show.xml  |   1 -
 17 files changed, 534 deletions(-)

diff --git 
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
 
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
index 846f170bdfe..b422fb29a86 100644
--- 
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
+++ 
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
@@ -58,7 +58,6 @@ RAL (Resource & Rule Administration Language) 为 Apache 
ShardingSphere 的管
 
|:--------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------|
 | SHOW INSTANCE INFO                                                        | 
查询当前 proxy 的实例信息                                                                
                           | SHOW INSTANCE INFO                                 
       |
 | SHOW MODE INFO                                                            | 
查询当前 proxy 的 mode 配置                                                            
                            | SHOW MODE INFO                                    
        |
-| COUNT DATABASE RULES [FROM database]                                      | 
查询 database 中的规则数量                                                              
                            | COUNT DATABASE RULES                              
        |
 | SET VARIABLE proxy_property_name = xx                                     | 
proxy_property_name 为 proxy 
的[属性配置](/cn/user-manual/shardingsphere-proxy/yaml-config/props/) ,需使用下划线命名 | 
SET VARIABLE sql_show = true                              |
 | SET VARIABLE transaction_type = xx                                        | 
修改当前连接的事务类型, 支持 LOCAL,XA,BASE                                                   
                       | SET VARIABLE transaction_type = "XA"                   
   |
 | SET VARIABLE agent_plugins_enabled = [TRUE / FALSE]                       | 
设置 agent 插件的启用状态,默认值 false                                                      
                        | SET VARIABLE agent_plugins_enabled = TRUE             
    |
diff --git 
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.en.md
 
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.en.md
index 949a279f2a7..4e9aa54c608 100644
--- 
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.en.md
+++ 
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.en.md
@@ -58,7 +58,6 @@ RAL (Resource & Rule Administration Language) responsible for 
hint, circuit brea
 
|:--------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------
 |
 | SHOW INSTANCE INFO                                                        | 
Query the instance information of the proxy                                     
                                                                        | SHOW 
INSTANCE INFO                                        |
 | SHOW MODE INFO                                                            | 
Query the mode configuration of the proxy                                       
                                                                        | SHOW 
MODE INFO                                        |
-| COUNT DATABASE RULES [FROM database]                                      | 
Query the number of rules in a database                                         
                                                                        | COUNT 
DATABASE RULES                                      |
 | SET VARIABLE proxy_property_name = xx                                     | 
proxy_property_name is one of [properties 
configuration](/en/user-manual/shardingsphere-proxy/yaml-config/props/) of 
proxy, name is split by underscore | SET VARIABLE sql_show = true               
               |  
 | SET VARIABLE transaction_type = xx                                        | 
Modify transaction_type of the current connection, supports LOCAL, XA, BASE     
                                                                        | SET 
VARIABLE transaction_type = "XA"                      |
 | SET VARIABLE agent_plugins_enabled = [TRUE / FALSE]                       | 
Set whether the agent plugins are enabled, the default value is false           
                                                                        | SET 
VARIABLE agent_plugins_enabled = TRUE                 |
diff --git 
a/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/imports/RQLStatement.g4
 
b/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/imports/RQLStatement.g4
index 5ff87d4a1df..f13bc642825 100644
--- 
a/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/imports/RQLStatement.g4
+++ 
b/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/imports/RQLStatement.g4
@@ -35,10 +35,6 @@ showSingleTable
     : SHOW SINGLE (TABLES | TABLE tableName) (FROM databaseName)?
     ;
 
-countDatabaseRules
-    : COUNT DATABASE RULES (FROM databaseName)?
-    ;
-
 showRulesUsedResource
     : SHOW RULES USED RESOURCE resourceName (FROM databaseName)?
     ;
diff --git 
a/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4
 
b/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4
index d27e5546715..2724e158d6a 100644
--- 
a/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4
+++ 
b/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/org/apache/shardingsphere/distsql/parser/autogen/KernelDistSQLStatement.g4
@@ -38,7 +38,6 @@ execute
     | unlabelInstance
     | countSingleTableRule
     | alterInstance
-    | countDatabaseRules
     | prepareDistSQL
     | applyDistSQL
     | discardDistSQL
diff --git 
a/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
 
b/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
index 0d677e5579b..0ffef2cc0ec 100644
--- 
a/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
+++ 
b/shardingsphere-distsql/shardingsphere-distsql-parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
@@ -30,7 +30,6 @@ import 
org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementPa
 import 
org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.BatchSizeContext;
 import 
org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ClearHintContext;
 import 
org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.ConvertYamlConfigurationContext;
-import 
org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.CountDatabaseRulesContext;
 import 
org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.CountSingleTableRuleContext;
 import 
org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.CreateDefaultSingleTableRuleContext;
 import 
org.apache.shardingsphere.distsql.parser.autogen.KernelDistSQLStatementParser.CreateMigrationProcessConfigurationContext;
@@ -107,7 +106,6 @@ import 
org.apache.shardingsphere.distsql.parser.statement.rdl.create.AddResource
 import 
org.apache.shardingsphere.distsql.parser.statement.rdl.create.CreateDefaultSingleTableRuleStatement;
 import 
org.apache.shardingsphere.distsql.parser.statement.rdl.drop.DropDefaultSingleTableRuleStatement;
 import 
org.apache.shardingsphere.distsql.parser.statement.rdl.drop.DropResourceStatement;
-import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.CountDatabaseRulesStatement;
 import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.CountSingleTableRuleStatement;
 import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowResourcesStatement;
 import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowRulesUsedResourceStatement;
@@ -215,11 +213,6 @@ public final class KernelDistSQLStatementVisitor extends 
KernelDistSQLStatementB
         return new 
AlterInstanceStatement(getIdentifierValue(ctx.instanceId()), 
getIdentifierValue(ctx.variableName()), 
getIdentifierValue(ctx.variableValues()));
     }
     
-    @Override
-    public ASTNode visitCountDatabaseRules(final CountDatabaseRulesContext 
ctx) {
-        return new CountDatabaseRulesStatement(null == ctx.databaseName() ? 
null : (DatabaseSegment) visit(ctx.databaseName()));
-    }
-    
     @Override
     public ASTNode visitCreateDefaultSingleTableRule(final 
CreateDefaultSingleTableRuleContext ctx) {
         return new 
CreateDefaultSingleTableRuleStatement(getIdentifierValue(ctx.resourceName()));
diff --git 
a/shardingsphere-distsql/shardingsphere-distsql-statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/rql/show/CountDatabaseRulesStatement.java
 
b/shardingsphere-distsql/shardingsphere-distsql-statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/rql/show/CountDatabaseRulesStatement.java
deleted file mode 100644
index 9efec9d9d92..00000000000
--- 
a/shardingsphere-distsql/shardingsphere-distsql-statement/src/main/java/org/apache/shardingsphere/distsql/parser/statement/rql/show/CountDatabaseRulesStatement.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.shardingsphere.distsql.parser.statement.rql.show;
-
-import 
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DatabaseSegment;
-
-/**
- * Count database rules statement.
- */
-public final class CountDatabaseRulesStatement extends ShowRulesStatement {
-    
-    public CountDatabaseRulesStatement(final DatabaseSegment database) {
-        super(database);
-    }
-}
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/DatabaseRulesCountResultSet.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/DatabaseRulesCountResultSet.java
deleted file mode 100644
index f0f55944ce0..00000000000
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/rule/DatabaseRulesCountResultSet.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule;
-
-import 
org.apache.shardingsphere.dbdiscovery.api.config.DatabaseDiscoveryRuleConfiguration;
-import org.apache.shardingsphere.dbdiscovery.rule.DatabaseDiscoveryRule;
-import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.CountDatabaseRulesStatement;
-import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.rule.EncryptRule;
-import org.apache.shardingsphere.infra.distsql.query.DatabaseDistSQLResultSet;
-import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import 
org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
-import 
org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingRule;
-import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
-import org.apache.shardingsphere.shadow.rule.ShadowRule;
-import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.rule.ShardingRule;
-import org.apache.shardingsphere.singletable.rule.SingleTableRule;
-import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Optional;
-
-/**
- * Query result set for count database rules.
- */
-public final class DatabaseRulesCountResultSet implements 
DatabaseDistSQLResultSet {
-    
-    private static final String SINGLE_TABLE = "single_table";
-    
-    private static final String SHARDING_TABLE = "sharding_table";
-    
-    private static final String SHARDING_BINDING_TABLE = 
"sharding_binding_table";
-    
-    private static final String SHARDING_BROADCAST_TABLE = 
"sharding_broadcast_table";
-    
-    private static final String READWRITE_SPLITTING = "readwrite_splitting";
-    
-    private static final String DB_DISCOVERY = "db_discovery";
-    
-    private static final String ENCRYPT = "encrypt";
-    
-    private static final String SHADOW = "shadow";
-    
-    private Iterator<Collection<Object>> data;
-    
-    @Override
-    public void init(final ShardingSphereDatabase database, final SQLStatement 
sqlStatement) {
-        // TODO Use LocalDataQueryResultRow to refactor Map<String, 
Collection<Object>> to Collection<LocalDataQueryResultRow>
-        Map<String, Collection<Object>> dataMap = new LinkedHashMap<>();
-        // TODO use ExportRule to export config
-        addSingleTableData(database, dataMap);
-        addShardingData(database, dataMap);
-        addReadwriteSplittingData(database, dataMap);
-        addDatabaseDiscoveryData(database, dataMap);
-        addEncryptData(database, dataMap);
-        addShadowData(database, dataMap);
-        data = dataMap.values().iterator();
-    }
-    
-    private void addSingleTableData(final ShardingSphereDatabase database, 
final Map<String, Collection<Object>> dataMap) {
-        SingleTableRule rule = 
database.getRuleMetaData().getSingleRule(SingleTableRule.class);
-        dataMap.put(SINGLE_TABLE, Arrays.asList(SINGLE_TABLE, 
rule.getAllTables().size()));
-    }
-    
-    private void addShardingData(final ShardingSphereDatabase database, final 
Map<String, Collection<Object>> dataMap) {
-        Optional<ShardingRule> rule = 
database.getRuleMetaData().findSingleRule(ShardingRule.class);
-        int shardingTableCount = 0;
-        int shardingBindingTableCount = 0;
-        int shardingBroadcastTableCount = 0;
-        if (rule.isPresent()) {
-            ShardingRuleConfiguration config = (ShardingRuleConfiguration) 
rule.get().getConfiguration();
-            shardingTableCount = config.getTables().size() + 
config.getAutoTables().size();
-            shardingBindingTableCount = config.getBindingTableGroups().size();
-            shardingBroadcastTableCount = config.getBroadcastTables().size();
-        }
-        addData(dataMap, SHARDING_TABLE, shardingTableCount);
-        addData(dataMap, SHARDING_BINDING_TABLE, shardingBindingTableCount);
-        addData(dataMap, SHARDING_BROADCAST_TABLE, 
shardingBroadcastTableCount);
-    }
-    
-    private void addReadwriteSplittingData(final ShardingSphereDatabase 
database, final Map<String, Collection<Object>> dataMap) {
-        Optional<ReadwriteSplittingRule> rule = 
database.getRuleMetaData().findSingleRule(ReadwriteSplittingRule.class);
-        int dataSourceCount = 0;
-        if (rule.isPresent()) {
-            dataSourceCount = ((ReadwriteSplittingRuleConfiguration) 
rule.get().getConfiguration()).getDataSources().size();
-        }
-        addData(dataMap, READWRITE_SPLITTING, dataSourceCount);
-    }
-    
-    private void addDatabaseDiscoveryData(final ShardingSphereDatabase 
database, final Map<String, Collection<Object>> dataMap) {
-        Optional<DatabaseDiscoveryRule> rule = 
database.getRuleMetaData().findSingleRule(DatabaseDiscoveryRule.class);
-        int dataSourceCount = 0;
-        if (rule.isPresent()) {
-            dataSourceCount = ((DatabaseDiscoveryRuleConfiguration) 
rule.get().getConfiguration()).getDataSources().size();
-        }
-        addData(dataMap, DB_DISCOVERY, dataSourceCount);
-    }
-    
-    private void addEncryptData(final ShardingSphereDatabase database, final 
Map<String, Collection<Object>> dataMap) {
-        Optional<EncryptRule> rule = 
database.getRuleMetaData().findSingleRule(EncryptRule.class);
-        int tableCount = 0;
-        if (rule.isPresent()) {
-            tableCount = ((EncryptRuleConfiguration) 
rule.get().getConfiguration()).getTables().size();
-        }
-        addData(dataMap, ENCRYPT, tableCount);
-    }
-    
-    private void addShadowData(final ShardingSphereDatabase database, final 
Map<String, Collection<Object>> dataMap) {
-        Optional<ShadowRule> rule = 
database.getRuleMetaData().findSingleRule(ShadowRule.class);
-        int dataSourceCount = 0;
-        if (rule.isPresent()) {
-            dataSourceCount = ((ShadowRuleConfiguration) 
rule.get().getConfiguration()).getDataSources().size();
-        }
-        addData(dataMap, SHADOW, dataSourceCount);
-    }
-    
-    private void addData(final Map<String, Collection<Object>> dataMap, final 
String dataKey, final int count) {
-        dataMap.put(dataKey, Arrays.asList(dataKey, count));
-    }
-    
-    @Override
-    public Collection<String> getColumnNames() {
-        return Arrays.asList("rule_name", "count");
-    }
-    
-    @Override
-    public boolean next() {
-        return data.hasNext();
-    }
-    
-    @Override
-    public Collection<Object> getRowData() {
-        return data.next();
-    }
-    
-    @Override
-    public String getType() {
-        return CountDatabaseRulesStatement.class.getName();
-    }
-}
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.query.DistSQLResultSet
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.query.DistSQLResultSet
index a0fb80c2b70..21896799843 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.query.DistSQLResultSet
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.distsql.query.DistSQLResultSet
@@ -19,7 +19,6 @@ 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.resource.DataSourceQ
 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.resource.UnusedDataSourceQueryResultSet
 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.SingleTableQueryResultSet
 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.SingleTableRulesQueryResultSet
-org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.DatabaseRulesCountResultSet
 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.RulesUsedResourceQueryResultSet
 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.CountSingleTableRuleQueryResultSet
 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.ShowMigrationProcessConfigurationQueryResultSet
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/DatabaseRulesCountResultSetTest.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/DatabaseRulesCountResultSetTest.java
deleted file mode 100644
index 54790ccd12f..00000000000
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rql/DatabaseRulesCountResultSetTest.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.shardingsphere.proxy.backend.handler.distsql.rql;
-
-import org.apache.shardingsphere.dbdiscovery.rule.DatabaseDiscoveryRule;
-import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.CountDatabaseRulesStatement;
-import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import 
org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
-import org.apache.shardingsphere.encrypt.rule.EncryptRule;
-import org.apache.shardingsphere.infra.distsql.query.DatabaseDistSQLResultSet;
-import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import 
org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
-import 
org.apache.shardingsphere.proxy.backend.handler.distsql.rql.rule.DatabaseRulesCountResultSet;
-import 
org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
-import 
org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceRuleConfiguration;
-import 
org.apache.shardingsphere.readwritesplitting.api.strategy.StaticReadwriteSplittingStrategyConfiguration;
-import 
org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingRule;
-import org.apache.shardingsphere.shadow.rule.ShadowRule;
-import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import 
org.apache.shardingsphere.sharding.api.config.rule.ShardingAutoTableRuleConfiguration;
-import 
org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
-import org.apache.shardingsphere.sharding.rule.ShardingRule;
-import org.apache.shardingsphere.singletable.rule.SingleTableRule;
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Optional;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public final class DatabaseRulesCountResultSetTest {
-    
-    @Test
-    public void assertGetRowData() {
-        DatabaseDistSQLResultSet resultSet = new DatabaseRulesCountResultSet();
-        resultSet.init(mockDatabase(), 
mock(CountDatabaseRulesStatement.class));
-        Collection<Object> actual = resultSet.getRowData();
-        assertThat(actual.size(), is(2));
-        Iterator<Object> rowData = actual.iterator();
-        assertThat(rowData.next(), is("single_table"));
-        assertThat(rowData.next(), is(2));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("sharding_table"));
-        assertThat(rowData.next(), is(2));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("sharding_binding_table"));
-        assertThat(rowData.next(), is(1));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("sharding_broadcast_table"));
-        assertThat(rowData.next(), is(2));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("readwrite_splitting"));
-        assertThat(rowData.next(), is(1));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("db_discovery"));
-        assertThat(rowData.next(), is(0));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("encrypt"));
-        assertThat(rowData.next(), is(1));
-    }
-    
-    private ShardingSphereDatabase mockDatabase() {
-        ShardingSphereDatabase result = mock(ShardingSphereDatabase.class);
-        ShardingSphereRuleMetaData ruleMetaData = 
mock(ShardingSphereRuleMetaData.class);
-        SingleTableRule singleTableRule = mockSingleTableRule();
-        
when(ruleMetaData.getSingleRule(SingleTableRule.class)).thenReturn(singleTableRule);
-        ShardingRule shardingRule = mockShardingTableRule();
-        
when(ruleMetaData.findSingleRule(ShardingRule.class)).thenReturn(Optional.of(shardingRule));
-        ReadwriteSplittingRule readwriteSplittingRule = 
mockReadwriteSplittingRule();
-        
when(ruleMetaData.findSingleRule(ReadwriteSplittingRule.class)).thenReturn(Optional.of(readwriteSplittingRule));
-        
when(ruleMetaData.findSingleRule(DatabaseDiscoveryRule.class)).thenReturn(Optional.empty());
-        
when(ruleMetaData.findSingleRule(ShadowRule.class)).thenReturn(Optional.empty());
-        EncryptRule encryptRule = mockEncryptRule();
-        
when(ruleMetaData.findSingleRule(EncryptRule.class)).thenReturn(Optional.of(encryptRule));
-        when(result.getRuleMetaData()).thenReturn(ruleMetaData);
-        return result;
-    }
-    
-    private SingleTableRule mockSingleTableRule() {
-        SingleTableRule result = mock(SingleTableRule.class);
-        when(result.getAllTables()).thenReturn(Arrays.asList("single_table_1", 
"single_table_2"));
-        return result;
-    }
-    
-    private ShardingRule mockShardingTableRule() {
-        ShardingRule result = mock(ShardingRule.class);
-        ShardingRuleConfiguration config = 
mock(ShardingRuleConfiguration.class);
-        when(config.getTables()).thenReturn(Collections.singletonList(new 
ShardingTableRuleConfiguration("sharding_table")));
-        when(config.getAutoTables()).thenReturn(Collections.singletonList(new 
ShardingAutoTableRuleConfiguration("sharding_auto_table", null)));
-        
when(config.getBindingTableGroups()).thenReturn(Collections.singletonList("binding_table_1,binding_table_2"));
-        
when(config.getBroadcastTables()).thenReturn(Arrays.asList("broadcast_table_1", 
"broadcast_table_2"));
-        when(result.getConfiguration()).thenReturn(config);
-        return result;
-    }
-    
-    private ReadwriteSplittingRule mockReadwriteSplittingRule() {
-        ReadwriteSplittingRule result = mock(ReadwriteSplittingRule.class);
-        ReadwriteSplittingRuleConfiguration config = 
mock(ReadwriteSplittingRuleConfiguration.class);
-        when(config.getDataSources()).thenReturn(Collections.singletonList(new 
ReadwriteSplittingDataSourceRuleConfiguration("readwrite_splitting",
-                new StaticReadwriteSplittingStrategyConfiguration("", 
Collections.emptyList()), null, "")));
-        when(result.getConfiguration()).thenReturn(config);
-        return result;
-    }
-    
-    private EncryptRule mockEncryptRule() {
-        EncryptRule result = mock(EncryptRule.class);
-        EncryptRuleConfiguration config = mock(EncryptRuleConfiguration.class);
-        when(config.getTables()).thenReturn(Collections.singletonList(new 
EncryptTableRuleConfiguration("encrypt_table", Collections.emptyList(), 
false)));
-        when(result.getConfiguration()).thenReturn(config);
-        return result;
-    }
-    
-    @Test
-    public void assertGetRowDataWithoutConfiguration() {
-        DatabaseDistSQLResultSet resultSet = new DatabaseRulesCountResultSet();
-        resultSet.init(mockEmptyDatabase(), 
mock(CountDatabaseRulesStatement.class));
-        Collection<Object> actual = resultSet.getRowData();
-        assertThat(actual.size(), is(2));
-        Iterator<Object> rowData = actual.iterator();
-        assertThat(rowData.next(), is("single_table"));
-        assertThat(rowData.next(), is(2));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("sharding_table"));
-        assertThat(rowData.next(), is(0));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("sharding_binding_table"));
-        assertThat(rowData.next(), is(0));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("sharding_broadcast_table"));
-        assertThat(rowData.next(), is(0));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("readwrite_splitting"));
-        assertThat(rowData.next(), is(0));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("db_discovery"));
-        assertThat(rowData.next(), is(0));
-        resultSet.next();
-        actual = resultSet.getRowData();
-        rowData = actual.iterator();
-        assertThat(rowData.next(), is("encrypt"));
-        assertThat(rowData.next(), is(0));
-    }
-    
-    private ShardingSphereDatabase mockEmptyDatabase() {
-        ShardingSphereDatabase result = mock(ShardingSphereDatabase.class);
-        ShardingSphereRuleMetaData ruleMetaData = new 
ShardingSphereRuleMetaData(Collections.singleton(mockSingleTableRule()));
-        when(result.getRuleMetaData()).thenReturn(ruleMetaData);
-        return result;
-    }
-}
diff --git 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/count_database_rules.xml
 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/count_database_rules.xml
deleted file mode 100644
index f4a8b49ca74..00000000000
--- 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/count_database_rules.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
-  ~ 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="rule_name"/>
-        <column name="count"/>
-    </metadata>
-    <row values="single_table| 3"/>
-    <row values="sharding_table| 5"/>
-    <row values="sharding_binding_table| 1"/>
-    <row values="sharding_broadcast_table| 2"/>
-    <row values="readwrite_splitting| 0"/>
-    <row values="db_discovery| 0"/>
-    <row values="encrypt| 0"/>
-    <row values="shadow| 0"/>
-</dataset>
diff --git 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
index 236f7ffb202..af3c6d19b98 100644
--- 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
+++ 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
@@ -129,8 +129,4 @@
     <test-case sql="SHOW DB_DISCOVERY HEARTBEATS" 
scenario-types="sharding_governance">
         <assertion expected-data-file="show_discovery_heartbeats.xml" />
     </test-case>
-    
-    <test-case sql="COUNT DATABASE RULES" 
scenario-types="db,tbl,readwrite_splitting,encrypt,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt,encrypt_and_readwrite_splitting">
-        <assertion expected-data-file="count_database_rules.xml" />
-    </test-case>
 </integration-test-cases>
diff --git 
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/ShowRulesStatementAssert.java
 
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/ShowRulesStatementAssert.java
index d3c725a0233..512e0e0c915 100644
--- 
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/ShowRulesStatementAssert.java
+++ 
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/ShowRulesStatementAssert.java
@@ -23,7 +23,6 @@ import 
org.apache.shardingsphere.dbdiscovery.distsql.parser.statement.CountDatab
 import 
org.apache.shardingsphere.dbdiscovery.distsql.parser.statement.ShowDatabaseDiscoveryHeartbeatsStatement;
 import 
org.apache.shardingsphere.dbdiscovery.distsql.parser.statement.ShowDatabaseDiscoveryRulesStatement;
 import 
org.apache.shardingsphere.dbdiscovery.distsql.parser.statement.ShowDatabaseDiscoveryTypesStatement;
-import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.CountDatabaseRulesStatement;
 import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.CountSingleTableRuleStatement;
 import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowRulesStatement;
 import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowRulesUsedResourceStatement;
@@ -52,7 +51,6 @@ import 
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedSha
 import 
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingKeyGeneratorsStatement;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountDatabaseDiscoveryRuleStatementAssert;
-import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountDatabaseRulesStatementAssert;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountEncryptRuleStatementAssert;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountReadwriteSplittingRuleStatementAssert;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountShadowRuleStatementAssert;
@@ -81,7 +79,6 @@ import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowUnusedShardingKeyGeneratorsStatementAssert;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.SQLParserTestCase;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountDatabaseDiscoveryRuleStatementTestCase;
-import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountDatabaseRulesStatementTestCase;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountEncryptRuleStatementTestCase;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountReadwriteSplittingRuleStatementTestCase;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountShadowRuleStatementTestCase;
@@ -157,8 +154,6 @@ public final class ShowRulesStatementAssert {
             
ShowUnusedShardingKeyGeneratorsStatementAssert.assertIs(assertContext, 
(ShowUnusedShardingKeyGeneratorsStatement) actual, 
(ShowUnusedShardingKeyGeneratorsStatementTestCase) expected);
         } else if (actual instanceof ShowUnusedShardingAuditorsStatement) {
             ShowUnusedShardingAuditorsStatementAssert.assertIs(assertContext, 
(ShowUnusedShardingAuditorsStatement) actual, 
(ShowUnusedShardingAuditorsStatementTestCase) expected);
-        } else if (actual instanceof CountDatabaseRulesStatement) {
-            CountDatabaseRulesStatementAssert.assertIs(assertContext, 
(CountDatabaseRulesStatement) actual, (CountDatabaseRulesStatementTestCase) 
expected);
         } else if (actual instanceof ShowRulesUsedResourceStatement) {
             ShowRulesUsedResourceStatementAssert.assertIs(assertContext, 
(ShowRulesUsedResourceStatement) actual, 
(ShowRulesUsedResourceStatementTestCase) expected);
         } else if (actual instanceof 
ShowShardingTableRulesUsedAlgorithmStatement) {
diff --git 
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountDatabaseRulesStatementAssert.java
 
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountDatabaseRulesStatementAssert.java
deleted file mode 100644
index 969f64de6ce..00000000000
--- 
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountDatabaseRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- */
-
-package 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import 
org.apache.shardingsphere.distsql.parser.statement.rql.show.CountDatabaseRulesStatement;
-import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import 
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountDatabaseRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Count database rules statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class CountDatabaseRulesStatementAssert {
-    
-    /**
-     * Assert count database rules statement is correct with expected parser 
result.
-     *
-     * @param assertContext assert context
-     * @param actual actual count database rules statement
-     * @param expected expected count database rules statement test case
-     */
-    public static void assertIs(final SQLCaseAssertContext assertContext, 
final CountDatabaseRulesStatement actual, final 
CountDatabaseRulesStatementTestCase expected) {
-        if (null != expected.getDatabase()) {
-            assertTrue(assertContext.getText("Actual database should exist."), 
actual.getDatabase().isPresent());
-            DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(), 
expected.getDatabase());
-        } else {
-            assertFalse(assertContext.getText("Actual database should not 
exist."), actual.getDatabase().isPresent());
-        }
-    }
-}
diff --git 
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
 
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
index 8edd93ba033..9093f1d437b 100644
--- 
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
+++ 
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
@@ -376,7 +376,6 @@ import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rdl.drop.DropShardingKeyGeneratorStatementTestCase;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rdl.drop.DropShardingTableRuleStatementTestCase;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountDatabaseDiscoveryRuleStatementTestCase;
-import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountDatabaseRulesStatementTestCase;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountEncryptRuleStatementTestCase;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountReadwriteSplittingRuleStatementTestCase;
 import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountShadowRuleStatementTestCase;
@@ -1417,9 +1416,6 @@ public final class SQLParserTestCases {
     @XmlElement(name = "show-unused-sharding-algorithms")
     private final List<ShowUnusedShardingAlgorithmsStatementTestCase> 
showUnusedShardingAlgorithmsTestCases = new LinkedList<>();
     
-    @XmlElement(name = "count-database-rules")
-    private final List<CountDatabaseRulesStatementTestCase> 
countDatabaseRulesTestCases = new LinkedList<>();
-    
     @XmlElement(name = "show-unused-sharding-key-generators")
     private final List<ShowUnusedShardingKeyGeneratorsStatementTestCase> 
showUnusedShardingKeyGeneratorsTestCases = new LinkedList<>();
     
diff --git 
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/rql/CountDatabaseRulesStatementTestCase.java
 
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/rql/CountDatabaseRulesStatementTestCase.java
deleted file mode 100644
index 2264ab6da8f..00000000000
--- 
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/rql/CountDatabaseRulesStatementTestCase.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.
- */
-
-package 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql;
-
-import lombok.Getter;
-import lombok.Setter;
-import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.segment.impl.schema.ExpectedDatabase;
-import 
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.SQLParserTestCase;
-
-import javax.xml.bind.annotation.XmlElement;
-
-/**
- * Count database rules statement test case.
- */
-@Getter
-@Setter
-public final class CountDatabaseRulesStatementTestCase extends 
SQLParserTestCase {
-    
-    @XmlElement
-    private ExpectedDatabase database;
-}
diff --git 
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/rql/show.xml
 
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/rql/show.xml
index c75b244cc59..0303aefdb78 100644
--- 
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/rql/show.xml
+++ 
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/rql/show.xml
@@ -115,10 +115,6 @@
         <database name="databaseName" start-index="35" stop-index="46"/>
     </show-unused-sharding-auditors>
 
-    <count-database-rules sql-case-id="count-database-rules">
-        <database name="databaseName" start-index="26" stop-index="37"/>
-    </count-database-rules>
-
     <show-rules-used-resource sql-case-id="show-rules-used-resource" 
resource-name="ds_0">
         <database name="databaseName" start-index="35" stop-index="46"/>
     </show-rules-used-resource>
diff --git 
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/rql/show.xml
 
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/rql/show.xml
index 3d6e028cab3..c13b0f26838 100644
--- 
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/rql/show.xml
+++ 
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/rql/show.xml
@@ -41,7 +41,6 @@
     <distsql-case id="show-unused-sharding-algorithms" value="SHOW UNUSED 
SHARDING ALGORITHMS FROM databaseName" />
     <distsql-case id="show-unused-sharding-key-generators" value="SHOW UNUSED 
SHARDING KEY GENERATORS FROM databaseName" />
     <distsql-case id="show-unused-sharding-auditors" value="SHOW UNUSED 
SHARDING AUDITORS FROM databaseName" />
-    <distsql-case id="count-database-rules" value="COUNT DATABASE RULES FROM 
databaseName" />
     <distsql-case id="show-rules-used-resource" value="SHOW RULES USED 
RESOURCE ds_0 FROM databaseName" />
     <distsql-case id="show-sharding-table-rules-used-key-generator" 
value="SHOW SHARDING TABLE RULES USED KEY GENERATOR snowflake FROM sharding_db" 
/>
     <distsql-case id="show-sharding-table-rules-used-auditor" value="SHOW 
SHARDING TABLE RULES USED AUDITOR shardingKeyAudit FROM sharding_db" />

Reply via email to