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/09/19 10:24:09 UTC
[shardingsphere] branch master updated: Support audit declaration for create sharding table rule. (#20938)
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 b6baaf85bf2 Support audit declaration for create sharding table rule. (#20938)
b6baaf85bf2 is described below
commit b6baaf85bf20d1e8e28e5889765ed0df7bb4d44f
Author: Zonglei Dong <do...@apache.org>
AuthorDate: Mon Sep 19 18:24:01 2022 +0800
Support audit declaration for create sharding table rule. (#20938)
* Support audit declaration for create sharding table rule.
* Support audit declaration for create sharding table rule.
* add audit column for sharding table rule query result set.
* Fixes unit test compile error.
* Fixes checkstyle problem.
* add auditor check for create sharding table rule.
* Fixes variable name.
* Fixes code review.
* add audit logic for create table sharding rule.
* Fixes checkstyle problem.
* add audit logic for query table sharding rule result set.
* add audit metadata column for query table sharding rule result set.
* add audit metadata column for query table sharding rule result set.
* add audit metadata column for query table sharding rule result set.
* remove auditor value, fixes CI failure.
* add test config for sharding table rule auditor.
* Fixes auditor content for ResultSet.
* Fixes code review problem.
* remove unused import.
* add test case for sharding table auditor.
* add example template for sharding table auditor.
* add sharding table auditor feature some error.
* add audit for auto tables.
* add audit test SPI config.
* Fixes audit column name.
* Fixes audit IT test case.
* Fixes audit ResultSet style.
* Fixes audit IT test case error.
---
.../template/jdbc/java/config/Configuration.ftl | 1 +
.../template/jdbc/java/config/sharding.ftl | 2 +
.../jdbc/resources/properties/sharding.ftl | 4 ++
.../template/jdbc/resources/xml/sharding.ftl | 13 +++++-
.../resources/template/proxy/feature/sharding.ftl | 8 ++++
.../YamlShardingAutoTableRuleConfiguration.java | 3 ++
.../checker/ShardingTableRuleStatementChecker.java | 23 ++++++++++
.../ShardingTableRuleStatementConverter.java | 25 +++++++++++
.../query/ShardingAuditorsQueryResultSet.java | 9 +---
.../query/ShardingTableRuleQueryResultSet.java | 29 ++++++++++++-
.../UnusedShardingAuditorsQueryResultSet.java | 8 +---
.../AlterShardingTableRuleStatementUpdater.java | 1 +
.../CreateShardingTableRuleStatementUpdater.java | 1 +
.../checker/ShardingRuleStatementCheckerTest.java | 26 +++++++++++-
.../ShardingRuleStatementConverterTest.java | 14 +++++--
...ava => ShardingAuditorsQueryResultSetTest.java} | 42 ++++++-------------
.../query/ShardingTableRuleQueryResultSetTest.java | 13 +++++-
...ingTableRulesUsedAuditorQueryResultSetTest.java | 2 +-
.../UnusedShardingAuditorsQueryResultSetTest.java | 2 +-
.../src/main/antlr4/imports/sharding/Keyword.g4 | 8 ++++
.../main/antlr4/imports/sharding/RDLStatement.g4 | 30 ++++++++++++-
.../core/ShardingDistSQLStatementVisitor.java | 38 ++++++++++++++++-
.../parser/segment/AbstractTableRuleSegment.java | 3 ++
...eRuleSegment.java => AuditStrategySegment.java} | 36 ++++++++--------
.../parser/segment/AutoTableRuleSegment.java | 5 ++-
.../distsql/parser/segment/TableRuleSegment.java | 10 +++--
.../fixture/ITShardingAuditAlgorithmFixture.java | 49 ++++++++++++++++++++++
...rdingsphere.sharding.spi.ShardingAuditAlgorithm | 18 ++++++++
.../rql/dataset/db/show_sharding_auditors.xml | 1 +
.../show_sharding_table_auditor.xml} | 4 +-
.../rql/dataset/db/show_sharding_table_rule.xml | 4 +-
.../rql/dataset/db/show_sharding_table_rules.xml | 12 +++---
...itors.xml => show_unused_sharding_auditors.xml} | 0
.../show_sharding_auditors.xml | 1 +
.../show_sharding_table_auditor.xml} | 4 +-
.../show_sharding_table_rule.xml | 4 +-
.../show_sharding_table_rules.xml | 12 +++---
.../show_unused_sharding_auditors.xml} | 0
.../show_sharding_auditors.xml | 1 +
...uditors.xml => show_sharding_table_auditor.xml} | 5 ++-
.../show_sharding_table_rule.xml | 4 +-
.../show_sharding_table_rules.xml | 14 ++++---
.../show_unused_sharding_auditors.xml} | 0
.../show_sharding_table_auditor.xml} | 3 +-
.../dataset/encrypt/show_sharding_table_rule.xml | 2 +
.../dataset/encrypt/show_sharding_table_rules.xml | 2 +
.../show_unused_sharding_auditors.xml} | 0
.../show_sharding_table_auditor.xml} | 3 +-
.../show_sharding_table_rule.xml | 4 +-
.../show_sharding_table_rules.xml | 8 ++--
.../show_unused_sharding_auditors.xml} | 0
.../show_sharding_auditors.xml | 1 +
.../show_sharding_table_auditor.xml} | 5 ++-
.../show_sharding_table_rule.xml | 4 +-
.../show_sharding_table_rules.xml | 14 ++++---
.../show_unused_sharding_auditors.xml} | 0
.../mysql/show_sharding_table_auditor.xml} | 3 +-
.../mysql/show_sharding_table_rule.xml | 4 +-
.../mysql/show_sharding_table_rules.xml | 6 ++-
.../mysql/show_unused_sharding_auditors.xml} | 0
.../rql/dataset/tbl/show_sharding_auditors.xml | 1 +
.../show_sharding_table_auditor.xml} | 4 +-
.../rql/dataset/tbl/show_sharding_table_rule.xml | 4 +-
.../rql/dataset/tbl/show_sharding_table_rules.xml | 12 +++---
.../show_unused_sharding_auditors.xml} | 0
.../cases/rql/rql-integration-test-cases.xml | 8 ++++
.../scenario/db/proxy/conf/mysql/config-db.yaml | 8 ++++
.../db/proxy/conf/postgresql/config-db.yaml | 8 ++++
.../src/test/resources/env/scenario/db/rules.yaml | 8 ++++
.../config-dbtbl-with-readwrite-splitting.yaml | 8 ++++
.../config-dbtbl-with-readwrite-splitting.yaml | 8 ++++
.../dbtbl_with_readwrite_splitting/rules.yaml | 8 ++++
...dbtbl-with-readwrite-splitting-and-encrypt.yaml | 12 ++++++
...dbtbl-with-readwrite-splitting-and-encrypt.yaml | 12 ++++++
.../rules.yaml | 8 ++++
.../proxy/conf/mysql/config-empty-rules.yaml | 8 ++++
.../proxy/conf/postgresql/config-empty-rules.yaml | 8 ++++
.../conf/mysql/config-sharding-and-encrypt.yaml | 12 ++++++
.../postgresql/config-sharding-and-encrypt.yaml | 12 ++++++
.../env/scenario/sharding_and_encrypt/rules.yaml | 12 ++++++
.../scenario/tbl/proxy/conf/mysql/config-tbl.yaml | 8 ++++
.../tbl/proxy/conf/postgresql/config-tbl.yaml | 8 ++++
.../src/test/resources/env/scenario/tbl/rules.yaml | 8 ++++
83 files changed, 595 insertions(+), 138 deletions(-)
diff --git a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/Configuration.ftl b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/Configuration.ftl
index bde93e09920..99c94046657 100644
--- a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/Configuration.ftl
+++ b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/Configuration.ftl
@@ -28,6 +28,7 @@ import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
import org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepositoryConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
+import org.apache.shardingsphere.sharding.api.config.strategy.audit.ShardingAuditStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
</#if>
diff --git a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/sharding.ftl b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/sharding.ftl
index c1a02228993..adaef95a7a3 100644
--- a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/sharding.ftl
+++ b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/java/config/sharding.ftl
@@ -25,12 +25,14 @@
props.setProperty("algorithm-expression", "${r"ds_${user_id % 2}"}");
result.getShardingAlgorithms() .put("inline", new AlgorithmConfiguration("INLINE", props));
result.getKeyGenerators().put("snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties()));
+ result.getAuditors().put("sharding_key_required_auditor", new AlgorithmConfiguration("DML_SHARDING_CONDITIONS", new Properties()));
return result;
}
private static ShardingTableRuleConfiguration getOrderTableRuleConfiguration() {
ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_order");
result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("order_id", "snowflake"));
+ result.setAuditStrategy(new ShardingAuditStrategyConfiguration(Arrays.asList("sharding_key_required_auditor"), true));
return result;
}
diff --git a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/sharding.ftl b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/sharding.ftl
index d583449673b..e2085a1dedb 100644
--- a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/sharding.ftl
+++ b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/sharding.ftl
@@ -27,6 +27,8 @@ spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.shar
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
+spring.shardingsphere.rules.sharding.tables.t_order.audit-strategy.auditor-names=shardingKeyAudit
+spring.shardingsphere.rules.sharding.tables.t_order.audit-strategy.allow-hint-disable=true
spring.shardingsphere.rules.sharding.tables.t_order_item.actual-data-nodes=ds-$->{0..1}.t_order_item_$->{0..1}
spring.shardingsphere.rules.sharding.tables.t_order_item.table-strategy.standard.sharding-column=order_id
@@ -43,3 +45,5 @@ spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-inline.typ
spring.shardingsphere.rules.sharding.sharding-algorithms.t-order-item-inline.props.algorithm-expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
+
+spring.shardingsphere.rules.sharding.auditors.shardingKeyAudit.type=DML_SHARDING_CONDITIONS
diff --git a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/xml/sharding.ftl b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/xml/sharding.ftl
index 32d0c84a259..8adbe9cbcd6 100644
--- a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/xml/sharding.ftl
+++ b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/xml/sharding.ftl
@@ -24,15 +24,24 @@
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
</sharding:key-generate-algorithm>
+
+ <sharding:audit-algorithm id="auditAlgorithm" type="DML_SHARDING_CONDITIONS">
+ </sharding:audit-algorithm>
<sharding:key-generate-strategy id="orderKeyGenerator" column="order_id" algorithm-ref="snowflakeAlgorithm" />
<sharding:key-generate-strategy id="accountKeyGenerator" column="account_id" algorithm-ref="snowflakeAlgorithm" />
<sharding:key-generate-strategy id="itemKeyGenerator" column="order_item_id" algorithm-ref="snowflakeAlgorithm" />
+
+ <sharding:audit-strategy id="shardingKeyAudit" allow-hint-disable="true">
+ <sharding:auditors>
+ <sharding:auditor algorithm-ref="auditAlgorithm" />
+ </sharding:auditors>
+ </sharding:audit-strategy>
<sharding:rule id="shardingRule">
<sharding:table-rules>
- <sharding:table-rule logic-table="t_order" database-strategy-ref="databaseStrategy" key-generate-strategy-ref="orderKeyGenerator" />
- <sharding:table-rule logic-table="t_order_item" database-strategy-ref="databaseStrategy" key-generate-strategy-ref="itemKeyGenerator" />
+ <sharding:table-rule logic-table="t_order" database-strategy-ref="databaseStrategy" key-generate-strategy-ref="orderKeyGenerator" audit-strategy-ref="shardingKeyAudit" />
+ <sharding:table-rule logic-table="t_order_item" database-strategy-ref="databaseStrategy" key-generate-strategy-ref="itemKeyGenerator" audit-strategy-ref="shardingKeyAudit" />
<sharding:table-rule logic-table="t_account" database-strategy-ref="databaseStrategy" key-generate-strategy-ref="accountKeyGenerator" />
</sharding:table-rules>
<sharding:binding-table-rules>
diff --git a/examples/shardingsphere-example-generator/src/main/resources/template/proxy/feature/sharding.ftl b/examples/shardingsphere-example-generator/src/main/resources/template/proxy/feature/sharding.ftl
index d9aa892540a..4198b511252 100644
--- a/examples/shardingsphere-example-generator/src/main/resources/template/proxy/feature/sharding.ftl
+++ b/examples/shardingsphere-example-generator/src/main/resources/template/proxy/feature/sharding.ftl
@@ -34,6 +34,10 @@
keyGenerateStrategy:
column: order_item_id
keyGeneratorName: snowflake
+ auditStrategy:
+ auditorNames:
+ - sharding_key_required_auditor
+ allowHintDisable: true
autoTables:
t_order_auto:
actualDataSources: ds_0
@@ -71,3 +75,7 @@
keyGenerators:
snowflake:
type: SNOWFLAKE
+
+ auditors:
+ sharding_key_required_auditor:
+ type: DML_SHARDING_CONDITIONS
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/config/rule/YamlShardingAutoTableRuleConfiguration.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/config/rule/YamlShardingAutoTableRuleConfiguration.java
index 9494bdf346f..6fc783f8422 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/config/rule/YamlShardingAutoTableRuleConfiguration.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/config/rule/YamlShardingAutoTableRuleConfiguration.java
@@ -20,6 +20,7 @@ package org.apache.shardingsphere.sharding.yaml.config.rule;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.infra.util.yaml.YamlConfiguration;
+import org.apache.shardingsphere.sharding.yaml.config.strategy.audit.YamlShardingAuditStrategyConfiguration;
import org.apache.shardingsphere.sharding.yaml.config.strategy.keygen.YamlKeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlShardingStrategyConfiguration;
@@ -37,4 +38,6 @@ public final class YamlShardingAutoTableRuleConfiguration implements YamlConfigu
private YamlShardingStrategyConfiguration shardingStrategy;
private YamlKeyGenerateStrategyConfiguration keyGenerateStrategy;
+
+ private YamlShardingAuditStrategyConfiguration auditStrategy;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/checker/ShardingTableRuleStatementChecker.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/checker/ShardingTableRuleStatementChecker.java
index 592b100e92d..6b751cc303c 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/checker/ShardingTableRuleStatementChecker.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/checker/ShardingTableRuleStatementChecker.java
@@ -45,12 +45,15 @@ import org.apache.shardingsphere.sharding.api.sharding.ShardingAutoTableAlgorith
import org.apache.shardingsphere.sharding.distsql.handler.converter.ShardingTableRuleStatementConverter;
import org.apache.shardingsphere.sharding.distsql.handler.enums.ShardingStrategyType;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AbstractTableRuleSegment;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.AuditStrategySegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AutoTableRuleSegment;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.ShardingAuditorSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.ShardingStrategySegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.TableRuleSegment;
import org.apache.shardingsphere.sharding.exception.metadata.ShardingRuleNotFoundException;
import org.apache.shardingsphere.sharding.factory.KeyGenerateAlgorithmFactory;
import org.apache.shardingsphere.sharding.factory.ShardingAlgorithmFactory;
+import org.apache.shardingsphere.sharding.factory.ShardingAuditAlgorithmFactory;
import org.apache.shardingsphere.sharding.rule.BindingTableCheckedConfiguration;
import org.apache.shardingsphere.sharding.rule.TableRule;
import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
@@ -113,6 +116,7 @@ public final class ShardingTableRuleStatementChecker {
checkTables(databaseName, rules, currentRuleConfig, isCreate);
checkResources(databaseName, rules, database);
checkKeyGenerators(rules, currentRuleConfig);
+ checkAuditors(rules, currentRuleConfig);
Map<String, List<AbstractTableRuleSegment>> groupedTableRule = groupingByClassType(rules);
checkAutoTableRule(groupedTableRule.getOrDefault(AutoTableRuleSegment.class.getSimpleName(), Collections.emptyList()));
checkTableRule(databaseName, currentRuleConfig, groupedTableRule.getOrDefault(TableRuleSegment.class.getSimpleName(), Collections.emptyList()));
@@ -249,6 +253,24 @@ public final class ShardingTableRuleStatementChecker {
DistSQLException.predictionThrow(invalidKeyGenerators.isEmpty(), () -> new InvalidAlgorithmConfigurationException("key generator", invalidKeyGenerators));
}
+ private static void checkAuditors(final Collection<AbstractTableRuleSegment> rules, final ShardingRuleConfiguration currentRuleConfig) throws DistSQLException {
+ Set<String> notExistAuditors = new LinkedHashSet<>();
+ Set<String> requiredAuditors = new LinkedHashSet<>();
+ Collection<AuditStrategySegment> auditStrategySegments = rules.stream().map(AbstractTableRuleSegment::getAuditStrategySegment).filter(Objects::nonNull).collect(Collectors.toList());
+ Collection<String> auditorNames = new LinkedList<>();
+ for (AuditStrategySegment each : auditStrategySegments) {
+ auditorNames.addAll(each.getAuditorNames());
+ }
+ auditorNames.stream().filter(each -> null == currentRuleConfig || !currentRuleConfig.getAuditors().containsKey(each)).collect(Collectors.toList()).forEach(notExistAuditors::add);
+ DistSQLException.predictionThrow(notExistAuditors.isEmpty(), () -> new RequiredAlgorithmMissedException("auditor", notExistAuditors));
+ for (AuditStrategySegment each : auditStrategySegments) {
+ requiredAuditors.addAll(each.getShardingAuditorSegments().stream().map(ShardingAuditorSegment::getAlgorithmSegment).collect(Collectors.toList())
+ .stream().map(AlgorithmSegment::getName).collect(Collectors.toList()));
+ }
+ Collection<String> invalidAuditors = requiredAuditors.stream().distinct().filter(each -> !ShardingAuditAlgorithmFactory.contains(each)).collect(Collectors.toList());
+ DistSQLException.predictionThrow(invalidAuditors.isEmpty(), () -> new InvalidAlgorithmConfigurationException("auditor", invalidAuditors));
+ }
+
private static void checkAutoTableRule(final Collection<AbstractTableRuleSegment> rules) throws DistSQLException {
Collection<AutoTableRuleSegment> autoTableRules = rules.stream().map(each -> (AutoTableRuleSegment) each).collect(Collectors.toList());
Optional<AlgorithmSegment> anyAutoTableRule = autoTableRules.stream().map(AutoTableRuleSegment::getShardingAlgorithmSegment).filter(Objects::nonNull).findAny();
@@ -327,6 +349,7 @@ public final class ShardingTableRuleStatementChecker {
toBeCheckedRuleConfig.setDefaultShardingColumn(currentRuleConfig.getDefaultShardingColumn());
toBeCheckedRuleConfig.setShardingAlgorithms(new LinkedHashMap<>(currentRuleConfig.getShardingAlgorithms()));
toBeCheckedRuleConfig.setKeyGenerators(new LinkedHashMap<>(currentRuleConfig.getKeyGenerators()));
+ toBeCheckedRuleConfig.setAuditors(new LinkedHashMap<>(currentRuleConfig.getAuditors()));
removeRuleConfiguration(toBeCheckedRuleConfig, toBeAlteredRuleConfig);
addRuleConfiguration(toBeCheckedRuleConfig, toBeAlteredRuleConfig);
Collection<String> dataSourceNames = getRequiredResource(toBeCheckedRuleConfig);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/converter/ShardingTableRuleStatementConverter.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/converter/ShardingTableRuleStatementConverter.java
index ef96e08daa0..68b14d368c9 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/converter/ShardingTableRuleStatementConverter.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/converter/ShardingTableRuleStatementConverter.java
@@ -24,20 +24,25 @@ import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
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.api.config.strategy.audit.ShardingAuditStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.ShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.distsql.handler.enums.ShardingStrategyLevelType;
import org.apache.shardingsphere.sharding.distsql.handler.enums.ShardingStrategyType;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AbstractTableRuleSegment;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.AuditStrategySegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AutoTableRuleSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.KeyGenerateStrategySegment;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.ShardingAuditorSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.ShardingStrategySegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.TableRuleSegment;
import java.util.Collection;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Optional;
+import java.util.stream.Collectors;
/**
* Sharding table rule converter.
@@ -55,6 +60,7 @@ public final class ShardingTableRuleStatementConverter {
ShardingRuleConfiguration result = new ShardingRuleConfiguration();
rules.forEach(each -> {
result.getKeyGenerators().putAll(createKeyGeneratorConfiguration(each));
+ result.getAuditors().putAll(createAuditorConfiguration(each));
if (each instanceof AutoTableRuleSegment) {
result.getShardingAlgorithms().putAll(createAlgorithmConfiguration((AutoTableRuleSegment) each));
result.getAutoTables().add(createAutoTableRuleConfiguration((AutoTableRuleSegment) each));
@@ -77,6 +83,16 @@ public final class ShardingTableRuleStatementConverter {
return result;
}
+ private static Map<String, AlgorithmConfiguration> createAuditorConfiguration(final AbstractTableRuleSegment rule) {
+ Map<String, AlgorithmConfiguration> result = new HashMap<>();
+ Optional.ofNullable(rule.getAuditStrategySegment()).ifPresent(optional -> {
+ for (ShardingAuditorSegment each : optional.getShardingAuditorSegments()) {
+ result.put(each.getAuditorName(), new AlgorithmConfiguration(each.getAlgorithmSegment().getName(), each.getAlgorithmSegment().getProps()));
+ }
+ });
+ return result;
+ }
+
private static Map<String, AlgorithmConfiguration> createAlgorithmConfiguration(final AutoTableRuleSegment rule) {
Map<String, AlgorithmConfiguration> result = new HashMap<>();
Optional.ofNullable(rule.getShardingAlgorithmSegment())
@@ -114,6 +130,8 @@ public final class ShardingTableRuleStatementConverter {
result.setShardingStrategy(createAutoTableStrategyConfiguration(rule));
Optional.ofNullable(rule.getKeyGenerateStrategySegment())
.ifPresent(optional -> result.setKeyGenerateStrategy(createKeyGenerateStrategyConfiguration(rule.getLogicTable(), rule.getKeyGenerateStrategySegment())));
+ Optional.ofNullable(rule.getAuditStrategySegment())
+ .ifPresent(optional -> result.setAuditStrategy(createShardingAuditStrategyConfiguration(rule.getAuditStrategySegment())));
return result;
}
@@ -133,6 +151,8 @@ public final class ShardingTableRuleStatementConverter {
ShardingStrategyLevelType.DATABASE, optional.getType(), optional)));
Optional.ofNullable(tableRuleSegment.getKeyGenerateStrategySegment())
.ifPresent(optional -> result.setKeyGenerateStrategy(createKeyGenerateStrategyConfiguration(tableRuleSegment.getLogicTable(), optional)));
+ Optional.ofNullable(tableRuleSegment.getAuditStrategySegment())
+ .ifPresent(optional -> result.setAuditStrategy(createShardingAuditStrategyConfiguration(optional)));
return result;
}
@@ -150,6 +170,11 @@ public final class ShardingTableRuleStatementConverter {
return new KeyGenerateStrategyConfiguration(segment.getKeyGenerateColumn(), getKeyGeneratorName(logicTable, segment.getKeyGenerateAlgorithmSegment().getName()));
}
+ private static ShardingAuditStrategyConfiguration createShardingAuditStrategyConfiguration(final AuditStrategySegment segment) {
+ List<String> auditorNames = segment.getShardingAuditorSegments().stream().map(ShardingAuditorSegment::getAuditorName).collect(Collectors.toList());
+ return new ShardingAuditStrategyConfiguration(auditorNames, segment.isAllowHintDisable());
+ }
+
/**
* Create strategy configuration.
*
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAuditorsQueryResultSet.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAuditorsQueryResultSet.java
index 98b7555e975..d9f9d7c8bd3 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAuditorsQueryResultSet.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAuditorsQueryResultSet.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.sharding.distsql.handler.query;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.distsql.query.DatabaseDistSQLResultSet;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingAuditorsStatement;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
@@ -32,9 +31,7 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map.Entry;
-import java.util.Objects;
import java.util.Optional;
-import java.util.Properties;
/**
* Query result set for show sharding auditors.
@@ -68,14 +65,10 @@ public final class ShardingAuditorsQueryResultSet implements DatabaseDistSQLResu
Collection<Object> result = new LinkedList<>();
result.add(data.getKey());
result.add(data.getValue().getType());
- result.add(buildProps(data.getValue().getProps()));
+ result.add(data.getValue().getProps());
return result;
}
- private Object buildProps(final Properties props) {
- return Objects.nonNull(props) ? PropertiesConverter.convert(props) : "";
- }
-
@Override
public String getType() {
return ShowShardingAuditorsStatement.class.getName();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingTableRuleQueryResultSet.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingTableRuleQueryResultSet.java
index fb87e13cac0..afe10594324 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingTableRuleQueryResultSet.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingTableRuleQueryResultSet.java
@@ -24,6 +24,7 @@ import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
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.api.config.strategy.audit.ShardingAuditStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.ComplexShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.NoneShardingStrategyConfiguration;
@@ -33,6 +34,7 @@ import org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingT
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@@ -75,7 +77,7 @@ public final class ShardingTableRuleQueryResultSet implements DatabaseDistSQLRes
public Collection<String> getColumnNames() {
return Arrays.asList("table", "actual_data_nodes", "actual_data_sources", "database_strategy_type", "database_sharding_column", "database_sharding_algorithm_type",
"database_sharding_algorithm_props", "table_strategy_type", "table_sharding_column", "table_sharding_algorithm_type", "table_sharding_algorithm_props",
- "key_generate_column", "key_generator_type", "key_generator_props");
+ "key_generate_column", "key_generator_type", "key_generator_props", "auditor_types", "allow_hint_disable");
}
@Override
@@ -106,6 +108,8 @@ public final class ShardingTableRuleQueryResultSet implements DatabaseDistSQLRes
result.add(getKeyGenerateColumn(shardingTableRuleConfig.getKeyGenerateStrategy()));
result.add(getKeyGeneratorType(shardingTableRuleConfig.getKeyGenerateStrategy()));
result.add(getKeyGeneratorProps(shardingTableRuleConfig.getKeyGenerateStrategy()));
+ result.add(getAuditorTypes(shardingTableRuleConfig.getAuditStrategy()));
+ result.add(getAllowHintDisable(shardingTableRuleConfig.getAuditStrategy()));
return result;
}
@@ -126,6 +130,8 @@ public final class ShardingTableRuleQueryResultSet implements DatabaseDistSQLRes
result.add(getKeyGenerateColumn(shardingAutoTableRuleConfig.getKeyGenerateStrategy()));
result.add(getKeyGeneratorType(shardingAutoTableRuleConfig.getKeyGenerateStrategy()));
result.add(getKeyGeneratorProps(shardingAutoTableRuleConfig.getKeyGenerateStrategy()));
+ result.add(getAuditorTypes(shardingAutoTableRuleConfig.getAuditStrategy()));
+ result.add(getAllowHintDisable(shardingAutoTableRuleConfig.getAuditStrategy()));
return result;
}
@@ -185,6 +191,27 @@ public final class ShardingTableRuleQueryResultSet implements DatabaseDistSQLRes
return null == keyGenerateStrategyConfig ? Optional.ofNullable(shardingRuleConfig.getDefaultKeyGenerateStrategy()) : Optional.of(keyGenerateStrategyConfig);
}
+ private String getAuditorTypes(final ShardingAuditStrategyConfiguration shardingAuditStrategyConfig) {
+ Optional<ShardingAuditStrategyConfiguration> auditStrategyConfig = getShardingAuditStrategyConfiguration(shardingAuditStrategyConfig);
+ Collection<String> auditorTypes = new ArrayList<>();
+ if (auditStrategyConfig.isPresent()) {
+ for (String each : auditStrategyConfig.get().getAuditorNames()) {
+ auditorTypes.add(shardingRuleConfig.getAuditors().get(each).getType());
+ }
+ }
+ return !auditorTypes.isEmpty() ? String.join(",", auditorTypes) : "";
+ }
+
+ private String getAllowHintDisable(final ShardingAuditStrategyConfiguration shardingAuditStrategyConfig) {
+ return getShardingAuditStrategyConfiguration(shardingAuditStrategyConfig).isPresent()
+ ? Boolean.valueOf(getShardingAuditStrategyConfiguration(shardingAuditStrategyConfig).get().isAllowHintDisable()).toString()
+ : "";
+ }
+
+ private Optional<ShardingAuditStrategyConfiguration> getShardingAuditStrategyConfiguration(final ShardingAuditStrategyConfiguration shardingAuditStrategyConfig) {
+ return null == shardingAuditStrategyConfig ? Optional.ofNullable(shardingRuleConfig.getDefaultAuditStrategy()) : Optional.of(shardingAuditStrategyConfig);
+ }
+
@Override
public String getType() {
return ShowShardingTableRulesStatement.class.getName();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/UnusedShardingAuditorsQueryResultSet.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/UnusedShardingAuditorsQueryResultSet.java
index 56a41d0f0eb..31137315447 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/UnusedShardingAuditorsQueryResultSet.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/UnusedShardingAuditorsQueryResultSet.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.sharding.distsql.handler.query;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.distsql.query.DatabaseDistSQLResultSet;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.util.props.PropertiesConverter;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.audit.ShardingAuditStrategyConfiguration;
import org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingAuditorsStatement;
@@ -38,7 +37,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Optional;
-import java.util.Properties;
/**
* Query result set for show unused sharding auditors.
@@ -94,14 +92,10 @@ public final class UnusedShardingAuditorsQueryResultSet implements DatabaseDistS
Collection<Object> result = new LinkedList<>();
result.add(data.getKey());
result.add(data.getValue().getType());
- result.add(buildProps(data.getValue().getProps()));
+ result.add(data.getValue().getProps());
return result;
}
- private Object buildProps(final Properties props) {
- return Objects.nonNull(props) ? PropertiesConverter.convert(props) : "";
- }
-
@Override
public String getType() {
return ShowUnusedShardingAuditorsStatement.class.getName();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/AlterShardingTableRuleStatementUpdater.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/AlterShardingTableRuleStatementUpdater.java
index 40c0333267b..87f8869c7b5 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/AlterShardingTableRuleStatementUpdater.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/AlterShardingTableRuleStatementUpdater.java
@@ -73,6 +73,7 @@ public final class AlterShardingTableRuleStatementUpdater implements RuleDefinit
currentRuleConfig.getAutoTables().addAll(toBeAlteredRuleConfig.getAutoTables());
currentRuleConfig.getShardingAlgorithms().putAll(toBeAlteredRuleConfig.getShardingAlgorithms());
currentRuleConfig.getKeyGenerators().putAll(toBeAlteredRuleConfig.getKeyGenerators());
+ currentRuleConfig.getAuditors().putAll(toBeAlteredRuleConfig.getAuditors());
}
@Override
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/CreateShardingTableRuleStatementUpdater.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/CreateShardingTableRuleStatementUpdater.java
index e967412bce2..21b8a271d48 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/CreateShardingTableRuleStatementUpdater.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/CreateShardingTableRuleStatementUpdater.java
@@ -47,6 +47,7 @@ public final class CreateShardingTableRuleStatementUpdater implements RuleDefini
currentRuleConfig.getAutoTables().addAll(toBeCreatedRuleConfig.getAutoTables());
currentRuleConfig.getShardingAlgorithms().putAll(toBeCreatedRuleConfig.getShardingAlgorithms());
currentRuleConfig.getKeyGenerators().putAll(toBeCreatedRuleConfig.getKeyGenerators());
+ currentRuleConfig.getAuditors().putAll(toBeCreatedRuleConfig.getAuditors());
}
@Override
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/checker/ShardingRuleStatementCheckerTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/checker/ShardingRuleStatementCheckerTest.java
index 935f21f7356..8e82f0dc37f 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/checker/ShardingRuleStatementCheckerTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/checker/ShardingRuleStatementCheckerTest.java
@@ -23,6 +23,7 @@ import org.apache.shardingsphere.infra.distsql.exception.DistSQLException;
import org.apache.shardingsphere.infra.distsql.exception.resource.RequiredResourceMissedException;
import org.apache.shardingsphere.infra.distsql.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.distsql.exception.rule.InvalidAlgorithmConfigurationException;
+import org.apache.shardingsphere.infra.distsql.exception.rule.RequiredAlgorithmMissedException;
import org.apache.shardingsphere.infra.distsql.exception.rule.RequiredRuleMissedException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.resource.ShardingSphereResource;
@@ -34,8 +35,10 @@ import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerate
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.distsql.handler.checker.ShardingTableRuleStatementChecker;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AbstractTableRuleSegment;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.AuditStrategySegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AutoTableRuleSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.KeyGenerateStrategySegment;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.ShardingAuditorSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.ShardingStrategySegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.TableRuleSegment;
import org.apache.shardingsphere.test.mock.MockedDataSource;
@@ -96,9 +99,9 @@ public final class ShardingRuleStatementCheckerTest {
shardingRuleConfig.getBindingTableGroups().add("t_order,t_order_item");
Collection<AbstractTableRuleSegment> rules = new LinkedList<>();
rules.add(new AutoTableRuleSegment("t_order", Arrays.asList("ds_0", "ds_1"), "order_id",
- new AlgorithmSegment("MOD", newProperties("sharding-count", "2")), null));
+ new AlgorithmSegment("MOD", newProperties("sharding-count", "2")), null, null));
rules.add(new AutoTableRuleSegment("t_order_item", Arrays.asList("ds_0", "ds_1"), "order_id",
- new AlgorithmSegment("MOD", newProperties("sharding-count", "2")), null));
+ new AlgorithmSegment("MOD", newProperties("sharding-count", "2")), null, null));
ShardingTableRuleStatementChecker.checkAlteration(database, rules, shardingRuleConfig);
}
@@ -136,6 +139,24 @@ public final class ShardingRuleStatementCheckerTest {
ShardingTableRuleStatementChecker.checkCreation(database, rules, shardingRuleConfig);
}
+ @Test(expected = RequiredAlgorithmMissedException.class)
+ public void assertCheckCreationWithMissedAuditAlgorithm() throws DistSQLException {
+ AutoTableRuleSegment autoTableRuleSegment = new AutoTableRuleSegment("t_product", Arrays.asList("ds_0", "ds_1"));
+ autoTableRuleSegment.setAuditStrategySegment(new AuditStrategySegment(Arrays.asList("invalid"),
+ Arrays.asList(new ShardingAuditorSegment("invalid", new AlgorithmSegment("DML_SHARDING_CONDITIONS", new Properties()))), true));
+ List<AbstractTableRuleSegment> rules = Collections.singletonList(autoTableRuleSegment);
+ ShardingTableRuleStatementChecker.checkCreation(database, rules, shardingRuleConfig);
+ }
+
+ @Test(expected = InvalidAlgorithmConfigurationException.class)
+ public void assertCheckCreationWithInvalidAuditAlgorithm() throws DistSQLException {
+ AutoTableRuleSegment autoTableRuleSegment = new AutoTableRuleSegment("t_product", Arrays.asList("ds_0", "ds_1"));
+ autoTableRuleSegment.setAuditStrategySegment(new AuditStrategySegment(Arrays.asList("sharding_key_required_auditor"),
+ Arrays.asList(new ShardingAuditorSegment("sharding_key_required_auditor", new AlgorithmSegment("invalid", new Properties()))), true));
+ List<AbstractTableRuleSegment> rules = Collections.singletonList(autoTableRuleSegment);
+ ShardingTableRuleStatementChecker.checkCreation(database, rules, shardingRuleConfig);
+ }
+
@Test(expected = InvalidAlgorithmConfigurationException.class)
public void assertCheckAutoTableWithNotExistShardingAlgorithms() throws DistSQLException {
AutoTableRuleSegment autoTableRuleSegment = new AutoTableRuleSegment("t_product", Arrays.asList("ds_0", "ds_1"));
@@ -224,6 +245,7 @@ public final class ShardingRuleStatementCheckerTest {
result.getAutoTables().add(autoTableRuleConfig);
result.getShardingAlgorithms().put("t_order_algorithm", new AlgorithmConfiguration("hash_mod", newProperties("sharding-count", "4")));
result.getKeyGenerators().put("t_order_item_snowflake", new AlgorithmConfiguration("snowflake", new Properties()));
+ result.getAuditors().put("sharding_key_required_auditor", new AlgorithmConfiguration("DML_SHARDING_CONDITIONS", new Properties()));
return result;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/converter/ShardingRuleStatementConverterTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/converter/ShardingRuleStatementConverterTest.java
index a3d2aa04d23..5243e94f5a3 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/converter/ShardingRuleStatementConverterTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/converter/ShardingRuleStatementConverterTest.java
@@ -23,8 +23,10 @@ import org.apache.shardingsphere.sharding.api.config.rule.ShardingAutoTableRuleC
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.distsql.handler.converter.ShardingTableRuleStatementConverter;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AbstractTableRuleSegment;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.AuditStrategySegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AutoTableRuleSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.KeyGenerateStrategySegment;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.ShardingAuditorSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.ShardingStrategySegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.TableRuleSegment;
import org.junit.Test;
@@ -67,19 +69,25 @@ public final class ShardingRuleStatementConverterTest {
assertThat(config.getKeyGenerators().size(), is(1));
assertThat(config.getKeyGenerators().get("t_order_snowflake").getType(), is("snowflake"));
assertThat(config.getKeyGenerators().get("t_order_snowflake").getProps().getProperty(""), is(""));
+ assertThat(config.getAuditors().get("sharding_key_required_auditor").getType(), is("DML_SHARDING_CONDITIONS"));
}
private Collection<AbstractTableRuleSegment> createTableRuleSegment1() {
Collection<AbstractTableRuleSegment> result = new LinkedList<>();
AutoTableRuleSegment autoTableRuleSegment1 = new AutoTableRuleSegment("t_order", Arrays.asList("ds0", "ds1"), "order_id",
- new AlgorithmSegment("MOD", newProperties("sharding_count", "2")), null);
+ new AlgorithmSegment("MOD", newProperties("sharding_count", "2")), null, null);
AlgorithmSegment databaseAlgorithmSegment = getAutoCreativeAlgorithmSegment("inline", newProperties("algorithm-expression", "ds_${product_id% 2}"));
AutoTableRuleSegment autoTableRuleSegment2 = new AutoTableRuleSegment("t_order_2", Arrays.asList("ds0", "ds1"), "order_id",
- new AlgorithmSegment("MOD", newProperties("sharding_count", "2")), new KeyGenerateStrategySegment("order_id", "snowflake_algorithm"));
+ new AlgorithmSegment("MOD", newProperties("sharding_count", "2")),
+ new KeyGenerateStrategySegment("order_id", "snowflake_algorithm"),
+ new AuditStrategySegment(Arrays.asList("sharding_key_required_auditor"), Arrays.asList(new ShardingAuditorSegment("sharding_key_required_auditor",
+ new AlgorithmSegment("DML_SHARDING_CONDITIONS", new Properties()))), true));
TableRuleSegment tableRuleSegment = new TableRuleSegment("t_order", Arrays.asList("ds0", "ds1"),
new ShardingStrategySegment("standard", "order_id", null, databaseAlgorithmSegment),
new ShardingStrategySegment("standard", "order_id", "order_id_algorithm", null),
- new KeyGenerateStrategySegment("order_id", new AlgorithmSegment("snowflake", newProperties("", ""))));
+ new KeyGenerateStrategySegment("order_id", new AlgorithmSegment("snowflake", newProperties("", ""))),
+ new AuditStrategySegment(Arrays.asList("sharding_key_required_auditor"), Arrays.asList(new ShardingAuditorSegment("sharding_key_required_auditor",
+ new AlgorithmSegment("DML_SHARDING_CONDITIONS", new Properties()))), true));
result.add(autoTableRuleSegment1);
result.add(autoTableRuleSegment2);
result.add(tableRuleSegment);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingAuditorsQueryResultSetTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingAuditorsQueryResultSetTest.java
similarity index 57%
copy from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingAuditorsQueryResultSetTest.java
copy to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingAuditorsQueryResultSetTest.java
index da1caccea45..0433cd76dba 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingAuditorsQueryResultSetTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingAuditorsQueryResultSetTest.java
@@ -18,18 +18,14 @@
package org.apache.shardingsphere.sharding.distsql.query;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
-import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.rule.ShardingAutoTableRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.strategy.audit.ShardingAuditStrategyConfiguration;
-import org.apache.shardingsphere.sharding.distsql.handler.query.UnusedShardingAuditorsQueryResultSet;
-import org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingAlgorithmsStatement;
+import org.apache.shardingsphere.sharding.distsql.handler.query.ShardingAuditorsQueryResultSet;
+import org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingAuditorsStatement;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.junit.Test;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Properties;
@@ -40,38 +36,26 @@ import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-public final class UnusedShardingAuditorsQueryResultSetTest {
+public final class ShardingAuditorsQueryResultSetTest {
@Test
public void assertGetRowData() {
- UnusedShardingAuditorsQueryResultSet resultSet = new UnusedShardingAuditorsQueryResultSet();
- resultSet.init(mockDatabase(), mock(ShowShardingAlgorithmsStatement.class));
- List<Object> actual = new ArrayList<>(resultSet.getRowData());
- assertThat(actual.size(), is(3));
- assertThat(actual.get(0), is("fixture"));
- assertThat(actual.get(1), is("FIXTURE"));
- assertThat(actual.get(2).toString(), is(""));
- }
-
- private ShardingSphereDatabase mockDatabase() {
- ShardingSphereDatabase result = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
+ ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
ShardingRule rule = mock(ShardingRule.class);
when(rule.getConfiguration()).thenReturn(createRuleConfiguration());
- when(result.getRuleMetaData().findSingleRule(ShardingRule.class)).thenReturn(Optional.of(rule));
- return result;
+ when(database.getRuleMetaData().findSingleRule(ShardingRule.class)).thenReturn(Optional.of(rule));
+ ShardingAuditorsQueryResultSet resultSet = new ShardingAuditorsQueryResultSet();
+ resultSet.init(database, mock(ShowShardingAuditorsStatement.class));
+ List<Object> actual = new ArrayList<>(resultSet.getRowData());
+ assertThat(actual.size(), is(3));
+ assertThat(actual.get(0), is("sharding_key_required_auditor"));
+ assertThat(actual.get(1), is("DML_SHARDING_CONDITIONS"));
+ assertThat(actual.get(2).toString(), is("{}"));
}
- private RuleConfiguration createRuleConfiguration() {
+ private ShardingRuleConfiguration createRuleConfiguration() {
ShardingRuleConfiguration result = new ShardingRuleConfiguration();
result.getAuditors().put("sharding_key_required_auditor", new AlgorithmConfiguration("DML_SHARDING_CONDITIONS", new Properties()));
- result.getAuditors().put("fixture", new AlgorithmConfiguration("FIXTURE", null));
- result.getAutoTables().add(createShardingAutoTableRuleConfiguration());
- return result;
- }
-
- private ShardingAutoTableRuleConfiguration createShardingAutoTableRuleConfiguration() {
- ShardingAutoTableRuleConfiguration result = new ShardingAutoTableRuleConfiguration("auto_table", null);
- result.setAuditStrategy(new ShardingAuditStrategyConfiguration(Collections.singleton("sharding_key_required_auditor"), false));
return result;
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingTableRuleQueryResultSetTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingTableRuleQueryResultSetTest.java
index 785819edf2f..9d36eb0763a 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingTableRuleQueryResultSetTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShardingTableRuleQueryResultSetTest.java
@@ -23,6 +23,7 @@ import org.apache.shardingsphere.infra.distsql.query.DatabaseDistSQLResultSet;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
+import org.apache.shardingsphere.sharding.api.config.strategy.audit.ShardingAuditStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.NoneShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -32,6 +33,7 @@ import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.junit.Test;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Properties;
@@ -49,7 +51,7 @@ public final class ShardingTableRuleQueryResultSetTest {
DatabaseDistSQLResultSet resultSet = new ShardingTableRuleQueryResultSet();
resultSet.init(mockDatabase(), mock(ShowShardingTableRulesStatement.class));
List<Object> actual = new ArrayList<>(resultSet.getRowData());
- assertThat(actual.size(), is(14));
+ assertThat(actual.size(), is(16));
assertThat(actual.get(0), is("t_order"));
assertThat(actual.get(1), is("ds_${0..1}.t_order_${0..1}"));
assertThat(actual.get(2), is(""));
@@ -63,6 +65,9 @@ public final class ShardingTableRuleQueryResultSetTest {
assertThat(actual.get(10), is("algorithm-expression=t_order_${order_id % 2}"));
assertThat(actual.get(11), is("order_id"));
assertThat(actual.get(12), is("SNOWFLAKE"));
+ assertThat(actual.get(13), is(""));
+ assertThat(actual.get(14), is("DML_SHARDING_CONDITIONS"));
+ assertThat(actual.get(15), is("true"));
}
private ShardingSphereDatabase mockDatabase() {
@@ -82,6 +87,7 @@ public final class ShardingTableRuleQueryResultSetTest {
result.getShardingAlgorithms().put("database_inline", createShardingInlineAlgorithmConfiguration("ds_${user_id % 2}"));
result.getShardingAlgorithms().put("t_order_inline", createShardingInlineAlgorithmConfiguration("t_order_${order_id % 2}"));
result.getKeyGenerators().put("snowflake", createKeyGeneratorConfiguration());
+ result.getAuditors().put("sharding_key_required_auditor", createAuditorConfiguration());
return result;
}
@@ -89,6 +95,7 @@ public final class ShardingTableRuleQueryResultSetTest {
ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_order", "ds_${0..1}.t_order_${0..1}");
result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "t_order_inline"));
result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("order_id", "snowflake"));
+ result.setAuditStrategy(new ShardingAuditStrategyConfiguration(Arrays.asList("sharding_key_required_auditor"), true));
return result;
}
@@ -101,4 +108,8 @@ public final class ShardingTableRuleQueryResultSetTest {
private AlgorithmConfiguration createKeyGeneratorConfiguration() {
return new AlgorithmConfiguration("SNOWFLAKE", new Properties());
}
+
+ private AlgorithmConfiguration createAuditorConfiguration() {
+ return new AlgorithmConfiguration("DML_SHARDING_CONDITIONS", new Properties());
+ }
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAuditorQueryResultSetTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAuditorQueryResultSetTest.java
index 3d2261bb14f..44cbe46f65b 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAuditorQueryResultSetTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAuditorQueryResultSetTest.java
@@ -75,7 +75,7 @@ public final class ShowShardingTableRulesUsedAuditorQueryResultSetTest {
result.getShardingAlgorithms().put("database_inline", createShardingInlineAlgorithmConfiguration("ds_${user_id % 2}"));
result.getShardingAlgorithms().put("t_order_inline", createShardingInlineAlgorithmConfiguration("t_order_${order_id % 2}"));
result.getShardingAlgorithms().put("auto_mod", createShardingAutoModAlgorithmConfiguration());
- result.getAuditors().put("shardingKeyAudit", createAuditorConfiguration());
+ result.getAuditors().put("sharding_key_required_auditor", createAuditorConfiguration());
return result;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingAuditorsQueryResultSetTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingAuditorsQueryResultSetTest.java
index da1caccea45..fae16299c49 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingAuditorsQueryResultSetTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/UnusedShardingAuditorsQueryResultSetTest.java
@@ -50,7 +50,7 @@ public final class UnusedShardingAuditorsQueryResultSetTest {
assertThat(actual.size(), is(3));
assertThat(actual.get(0), is("fixture"));
assertThat(actual.get(1), is("FIXTURE"));
- assertThat(actual.get(2).toString(), is(""));
+ assertThat(actual.get(2).toString(), is("{}"));
}
private ShardingSphereDatabase mockDatabase() {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/sharding/Keyword.g4 b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/sharding/Keyword.g4
index 5992fc37457..07aaa2096ea 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/sharding/Keyword.g4
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/sharding/Keyword.g4
@@ -222,3 +222,11 @@ AUDITOR
AUDITORS
: A U D I T O R S
;
+
+AUDIT_STRATEGY
+ : A U D I T UL_ S T R A T E G Y
+ ;
+
+ALLOW_HINT_DISABLE
+ : A L L O W UL_ H I N T UL_ D I S A B L E
+ ;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/sharding/RDLStatement.g4 b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/sharding/RDLStatement.g4
index f2e4e9a6cd3..f2fd0cbc1be 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/sharding/RDLStatement.g4
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/sharding/RDLStatement.g4
@@ -112,7 +112,7 @@ shardingAutoTableRule
;
shardingTableRule
- : tableName LP dataNodes (COMMA databaseStrategy)? (COMMA tableStrategy)? (COMMA keyGenerateDeclaration)? RP
+ : tableName LP dataNodes (COMMA databaseStrategy)? (COMMA tableStrategy)? (COMMA keyGenerateDeclaration)? (COMMA auditDeclaration)? RP
;
keyGeneratorDefinition
@@ -203,6 +203,34 @@ keyGenerateStrategy
: KEY_GENERATE_STRATEGY LP COLUMN EQ columnName COMMA keyGenerator RP
;
+auditDeclaration
+ : auditDefinition | auditStrategy
+ ;
+
+auditDefinition
+ : AUDIT_STRATEGY LP LBT multiAuditDefinition RBT COMMA ALLOW_HINT_DISABLE EQ auditAllowHintDisable RP
+ ;
+
+multiAuditDefinition
+ : singleAuditDefinition (COMMA singleAuditDefinition)*
+ ;
+
+singleAuditDefinition
+ : LP NAME EQ auditorName COMMA algorithmDefinition RP
+ ;
+
+auditStrategy
+ : AUDIT_STRATEGY LP AUDITORS EQ LBT auditorNames RBT COMMA ALLOW_HINT_DISABLE EQ auditAllowHintDisable RP
+ ;
+
+auditorNames
+ : auditorName (COMMA auditorName)*
+ ;
+
+auditAllowHintDisable
+ : TRUE | FALSE
+ ;
+
algorithmDefinition
: TYPE LP NAME EQ algorithmTypeName (COMMA PROPERTIES LP algorithmProperties? RP)? RP
;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/core/ShardingDistSQLStatementVisitor.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/core/ShardingDistSQLStatementVisitor.java
index cfe2de391a0..3f69651f033 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/core/ShardingDistSQLStatementVisitor.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/core/ShardingDistSQLStatementVisitor.java
@@ -30,7 +30,10 @@ import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatement
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.AlterShardingBroadcastTableRulesContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.AlterShardingKeyGeneratorContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.AlterShardingTableRuleContext;
+import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.AuditDefinitionContext;
+import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.AuditStrategyContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.AuditorDefinitionContext;
+import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.AuditorNameContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.AutoShardingColumnDefinitionContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.BindTableRulesDefinitionContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.ClearShardingHintContext;
@@ -46,11 +49,11 @@ import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatement
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.DatabaseNameContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.DropDefaultShardingStrategyContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.DropShardingAlgorithmContext;
+import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.DropShardingAuditorContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.DropShardingBindingTableRulesContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.DropShardingBroadcastTableRulesContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.DropShardingKeyGeneratorContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.DropShardingTableRuleContext;
-import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.DropShardingAuditorContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.KeyGenerateDefinitionContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.KeyGenerateStrategyContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.KeyGeneratorDefinitionContext;
@@ -77,10 +80,12 @@ import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatement
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.ShowUnusedShardingAlgorithmsContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.ShowUnusedShardingAuditorsContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.ShowUnusedShardingKeyGeneratorsContext;
+import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.SingleAuditDefinitionContext;
import org.apache.shardingsphere.distsql.parser.autogen.ShardingDistSQLStatementParser.TableNameContext;
import org.apache.shardingsphere.distsql.parser.segment.AlgorithmSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AbstractTableRuleSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AbstractTableRuleSegment.EmptyTableRuleSegment;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.AuditStrategySegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.AutoTableRuleSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.BindingTableRuleSegment;
import org.apache.shardingsphere.sharding.distsql.parser.segment.KeyGenerateStrategySegment;
@@ -136,6 +141,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DatabaseS
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
@@ -320,7 +326,8 @@ public final class ShardingDistSQLStatementVisitor extends ShardingDistSQLStatem
@Override
public ASTNode visitShardingTableRule(final ShardingTableRuleContext ctx) {
KeyGenerateStrategySegment keyGenerateSegment = null != ctx.keyGenerateDeclaration() ? (KeyGenerateStrategySegment) visit(ctx.keyGenerateDeclaration()) : null;
- TableRuleSegment result = new TableRuleSegment(getIdentifierValue(ctx.tableName()), getDataNodes(ctx.dataNodes()), keyGenerateSegment);
+ AuditStrategySegment auditStrategySegment = null != ctx.auditDeclaration() ? (AuditStrategySegment) visit(ctx.auditDeclaration()) : null;
+ TableRuleSegment result = new TableRuleSegment(getIdentifierValue(ctx.tableName()), getDataNodes(ctx.dataNodes()), keyGenerateSegment, auditStrategySegment);
Optional.ofNullable(ctx.tableStrategy()).ifPresent(optional -> result.setTableStrategySegment((ShardingStrategySegment) visit(ctx.tableStrategy().shardingStrategy())));
Optional.ofNullable(ctx.databaseStrategy()).ifPresent(optional -> result.setDatabaseStrategySegment((ShardingStrategySegment) visit(ctx.databaseStrategy().shardingStrategy())));
return result;
@@ -351,6 +358,33 @@ public final class ShardingDistSQLStatementVisitor extends ShardingDistSQLStatem
return null == ctx ? null : new KeyGenerateStrategySegment(getIdentifierValue(ctx.columnName()), (AlgorithmSegment) visit(ctx.algorithmDefinition()));
}
+ @Override
+ public ASTNode visitAuditStrategy(final AuditStrategyContext ctx) {
+ if (null == ctx) {
+ return null;
+ }
+ Collection<String> auditorNames = new LinkedList<>();
+ for (AuditorNameContext each : ctx.auditorNames().auditorName()) {
+ auditorNames.add(getIdentifierValue(each));
+ }
+ return new AuditStrategySegment(auditorNames, Boolean.parseBoolean(getIdentifierValue(ctx.auditAllowHintDisable())));
+ }
+
+ @Override
+ public ASTNode visitAuditDefinition(final AuditDefinitionContext ctx) {
+ if (null == ctx) {
+ return null;
+ }
+ Collection<ShardingAuditorSegment> shardingAuditorSegments = new ArrayList<>();
+ Collection<String> auditorNames = new ArrayList<>();
+ for (SingleAuditDefinitionContext each : ctx.multiAuditDefinition().singleAuditDefinition()) {
+ ShardingAuditorSegment segment = new ShardingAuditorSegment(getIdentifierValue(each.auditorName()), (AlgorithmSegment) visit(each.algorithmDefinition()));
+ shardingAuditorSegments.add(segment);
+ auditorNames.add(getIdentifierValue(each.auditorName()));
+ }
+ return new AuditStrategySegment(auditorNames, shardingAuditorSegments, Boolean.parseBoolean(getIdentifierValue(ctx.auditAllowHintDisable())));
+ }
+
@Override
public ASTNode visitShardingStrategy(final ShardingStrategyContext ctx) {
if (null == ctx) {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AbstractTableRuleSegment.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AbstractTableRuleSegment.java
index aeff7104eba..344bcc07247 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AbstractTableRuleSegment.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AbstractTableRuleSegment.java
@@ -40,6 +40,9 @@ public abstract class AbstractTableRuleSegment implements ASTNode {
@Setter
private KeyGenerateStrategySegment keyGenerateStrategySegment;
+ @Setter
+ private AuditStrategySegment auditStrategySegment;
+
/**
* Empty table rule segment.
*/
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AbstractTableRuleSegment.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AuditStrategySegment.java
similarity index 53%
copy from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AbstractTableRuleSegment.java
copy to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AuditStrategySegment.java
index aeff7104eba..8de2ba73340 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AbstractTableRuleSegment.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AuditStrategySegment.java
@@ -17,36 +17,34 @@
package org.apache.shardingsphere.sharding.distsql.parser.segment;
-import lombok.AllArgsConstructor;
import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import lombok.Setter;
import org.apache.shardingsphere.sql.parser.api.visitor.ASTNode;
import java.util.Collection;
+import java.util.Collections;
/**
- * Abstract table rule segment.
+ * Audit strategy segment.
*/
-@RequiredArgsConstructor
-@AllArgsConstructor
@Getter
-public abstract class AbstractTableRuleSegment implements ASTNode {
+public final class AuditStrategySegment implements ASTNode {
- private final String logicTable;
+ private Collection<String> auditorNames;
- private final Collection<String> dataSourceNodes;
+ private Collection<ShardingAuditorSegment> shardingAuditorSegments;
- @Setter
- private KeyGenerateStrategySegment keyGenerateStrategySegment;
+ private final boolean allowHintDisable;
- /**
- * Empty table rule segment.
- */
- public static class EmptyTableRuleSegment extends AbstractTableRuleSegment {
-
- public EmptyTableRuleSegment() {
- super(null, null);
- }
+ public AuditStrategySegment(final Collection<String> auditorNames, final boolean allowHintDisable) {
+ this.auditorNames = auditorNames;
+ this.shardingAuditorSegments = Collections.EMPTY_LIST;
+ this.allowHintDisable = allowHintDisable;
+ }
+
+ public AuditStrategySegment(final Collection<String> auditorNames, final Collection<ShardingAuditorSegment> shardingAuditorSegments,
+ final boolean allowHintDisable) {
+ this.auditorNames = auditorNames;
+ this.shardingAuditorSegments = shardingAuditorSegments;
+ this.allowHintDisable = allowHintDisable;
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AutoTableRuleSegment.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AutoTableRuleSegment.java
index 125a8354fdd..88228ee2c6e 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AutoTableRuleSegment.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/AutoTableRuleSegment.java
@@ -40,8 +40,9 @@ public final class AutoTableRuleSegment extends AbstractTableRuleSegment {
}
public AutoTableRuleSegment(final String logicTable, final Collection<String> dataSources, final String shardingColumn,
- final AlgorithmSegment shardingAlgorithm, final KeyGenerateStrategySegment keyGenerateStrategySegment) {
- super(logicTable, dataSources, keyGenerateStrategySegment);
+ final AlgorithmSegment shardingAlgorithm, final KeyGenerateStrategySegment keyGenerateStrategySegment,
+ final AuditStrategySegment auditStrategySegment) {
+ super(logicTable, dataSources, keyGenerateStrategySegment, auditStrategySegment);
this.shardingColumn = shardingColumn;
this.shardingAlgorithmSegment = shardingAlgorithm;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/TableRuleSegment.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/TableRuleSegment.java
index c8a038544a1..877fa621ce5 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/TableRuleSegment.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-statement/src/main/java/org/apache/shardingsphere/sharding/distsql/parser/segment/TableRuleSegment.java
@@ -39,13 +39,15 @@ public final class TableRuleSegment extends AbstractTableRuleSegment {
}
public TableRuleSegment(final String logicTable, final Collection<String> dataSourcesNote, final ShardingStrategySegment databaseStrategy,
- final ShardingStrategySegment tableStrategy, final KeyGenerateStrategySegment keyGenerateStrategySegment) {
- super(logicTable, dataSourcesNote, keyGenerateStrategySegment);
+ final ShardingStrategySegment tableStrategy, final KeyGenerateStrategySegment keyGenerateStrategySegment,
+ final AuditStrategySegment auditStrategySegment) {
+ super(logicTable, dataSourcesNote, keyGenerateStrategySegment, auditStrategySegment);
this.tableStrategySegment = tableStrategy;
this.databaseStrategySegment = databaseStrategy;
}
- public TableRuleSegment(final String logicTable, final Collection<String> dataSourcesNote, final KeyGenerateStrategySegment keyGenerateStrategySegment) {
- super(logicTable, dataSourcesNote, keyGenerateStrategySegment);
+ public TableRuleSegment(final String logicTable, final Collection<String> dataSourcesNote,
+ final KeyGenerateStrategySegment keyGenerateStrategySegment, final AuditStrategySegment auditStrategySegment) {
+ super(logicTable, dataSourcesNote, keyGenerateStrategySegment, auditStrategySegment);
}
}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/fixture/ITShardingAuditAlgorithmFixture.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/fixture/ITShardingAuditAlgorithmFixture.java
new file mode 100644
index 00000000000..a8f1dee6d6b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/fixture/ITShardingAuditAlgorithmFixture.java
@@ -0,0 +1,49 @@
+/*
+ * 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.integration.fixture;
+
+import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import org.apache.shardingsphere.infra.check.SQLCheckResult;
+import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
+import org.apache.shardingsphere.infra.metadata.user.Grantee;
+import org.apache.shardingsphere.sharding.spi.ShardingAuditAlgorithm;
+
+import java.util.List;
+import java.util.Properties;
+
+public final class ITShardingAuditAlgorithmFixture implements ShardingAuditAlgorithm {
+
+ @Override
+ public Properties getProps() {
+ return new Properties();
+ }
+
+ @Override
+ public void init(final Properties props) {
+ }
+
+ @Override
+ public SQLCheckResult check(final SQLStatementContext<?> sqlStatementContext, final List<Object> parameters, final Grantee grantee, final ShardingSphereDatabase database) {
+ return new SQLCheckResult(true, "");
+ }
+
+ @Override
+ public String getType() {
+ return "IT.AUDITOR.FIXTURE";
+ }
+}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAuditAlgorithm b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAuditAlgorithm
new file mode 100644
index 00000000000..95d19f8ea36
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAuditAlgorithm
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+org.apache.shardingsphere.test.integration.fixture.ITShardingAuditAlgorithmFixture
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
index 8af51b212cc..272eebbe056 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
@@ -21,4 +21,5 @@
<column name="type" />
<column name="props" />
</metadata>
+ <row values="auditor_constant| IT.AUDITOR.FIXTURE| {}" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_auditor.xml
similarity index 95%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_auditor.xml
index 8af51b212cc..fc16314648b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_auditor.xml
@@ -17,8 +17,8 @@
<dataset>
<metadata>
- <column name="name" />
<column name="type" />
- <column name="props" />
+ <column name="name" />
</metadata>
+ <row values="table| t_order_item" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_rule.xml
index e41de917080..d51bf64049f 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_rule.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_rule.xml
@@ -31,6 +31,8 @@
<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_order| ds_${0..9}.t_order| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | | | " />
+ <row values="t_order| ds_${0..9}.t_order| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_rules.xml
index b726755d381..61d4c3f7183 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_rules.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_table_rules.xml
@@ -31,10 +31,12 @@
<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_order| ds_${0..9}.t_order| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | | | " />
- <row values="t_order_item| ds_${0..9}.t_order_item| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | item_id| IT.FIXTURE| " />
- <row values="t_order_details| ds_${0..9}.t_order_details| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | | " />
- <row values="t_order_federate_sharding| ds_${0..1}.t_order_federate_sharding| | STANDARD| order_id_sharding| INLINE| algorithm-expression=ds_${order_id_sharding % 2}| | | | | | | " />
- <row values="t_order_item_federate_sharding| ds_${0..1}.t_order_item_federate_sharding| | STANDARD| item_id| INLINE| algorithm-expression=ds_${db_inline_item_id % 2}| | | | | | | " />
+ <row values="t_order| ds_${0..9}.t_order| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | | | | | " />
+ <row values="t_order_item| ds_${0..9}.t_order_item| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | item_id| IT.FIXTURE| | IT.AUDITOR.FIXTURE| true" />
+ <row values="t_order_details| ds_${0..9}.t_order_details| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | | | | " />
+ <row values="t_order_federate_sharding| ds_${0..1}.t_order_federate_sharding| | STANDARD| order_id_sharding| INLINE| algorithm-expression=ds_${order_id_sharding % 2}| | | | | | | | | " />
+ <row values="t_order_item_federate_sharding| ds_${0..1}.t_order_item_federate_sharding| | STANDARD| item_id| INLINE| algorithm-expression=ds_${db_inline_item_id % 2}| | | | | | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_unused_sharding_auditors.xml
similarity index 100%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_unused_sharding_auditors.xml
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_auditors.xml
index 8af51b212cc..272eebbe056 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_auditors.xml
@@ -21,4 +21,5 @@
<column name="type" />
<column name="props" />
</metadata>
+ <row values="auditor_constant| IT.AUDITOR.FIXTURE| {}" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_auditor.xml
similarity index 95%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_auditor.xml
index 8af51b212cc..fc16314648b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_auditor.xml
@@ -17,8 +17,8 @@
<dataset>
<metadata>
- <column name="name" />
<column name="type" />
- <column name="props" />
+ <column name="name" />
</metadata>
+ <row values="table| t_order_item" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_rule.xml
index efcb1ae02e6..c09feeba94b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_rule.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_rule.xml
@@ -31,6 +31,8 @@
<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_order| readwrite_ds_${0..9}.t_order_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | " />
+ <row values="t_order| readwrite_ds_${0..9}.t_order_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_rules.xml
index 64c536bd59b..2efe57177ab 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_rules.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_sharding_table_rules.xml
@@ -31,10 +31,12 @@
<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_order| readwrite_ds_${0..9}.t_order_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | " />
- <row values="t_order_item| readwrite_ds_${0..9}.t_order_item_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| order_id| IT.STANDARD.FIXTURE| | item_id| IT.FIXTURE| " />
- <row values="t_order_details| readwrite_ds_${0..9}.t_order_details_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | " />
- <row values="t_order_item_federate_sharding | readwrite_ds_1.t_order_item_federate_sharding_${0..1}| | | | | | STANDARD| item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}| | | " />
- <row values="t_order_federate_sharding | readwrite_ds_1.t_order_federate_sharding_${0..1}| | | | | | STANDARD| order_id_sharding| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2}| | | " />
+ <row values="t_order| readwrite_ds_${0..9}.t_order_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | | | " />
+ <row values="t_order_item| readwrite_ds_${0..9}.t_order_item_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| order_id| IT.STANDARD.FIXTURE| | item_id| IT.FIXTURE| | IT.AUDITOR.FIXTURE| true" />
+ <row values="t_order_details| readwrite_ds_${0..9}.t_order_details_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | | | " />
+ <row values="t_order_item_federate_sharding | readwrite_ds_1.t_order_item_federate_sharding_${0..1}| | | | | | STANDARD| item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}| | | | | " />
+ <row values="t_order_federate_sharding | readwrite_ds_1.t_order_federate_sharding_${0..1}| | | | | | STANDARD| order_id_sharding| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2}| | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_unused_sharding_auditors.xml
similarity index 100%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/show_unused_sharding_auditors.xml
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
index 8af51b212cc..272eebbe056 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
@@ -21,4 +21,5 @@
<column name="type" />
<column name="props" />
</metadata>
+ <row values="auditor_constant| IT.AUDITOR.FIXTURE| {}" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_auditor.xml
similarity index 92%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_auditor.xml
index 8af51b212cc..d4a6fdee9de 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_auditor.xml
@@ -17,8 +17,9 @@
<dataset>
<metadata>
- <column name="name" />
<column name="type" />
- <column name="props" />
+ <column name="name" />
</metadata>
+ <row values="table| t_user_item" />
+ <row values="table| t_user" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_rule.xml
index d78e611efb0..5e9f0a01fea 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_rule.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_rule.xml
@@ -31,6 +31,8 @@
<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| readwrite_ds_${0..9}.t_user_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | user_id| IT.FIXTURE| " />
+ <row values="t_user| readwrite_ds_${0..9}.t_user_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | user_id| IT.FIXTURE| | IT.AUDITOR.FIXTURE| true" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_rules.xml
index 72f9f74734a..a4456f1b604 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_rules.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_table_rules.xml
@@ -31,11 +31,13 @@
<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_item| readwrite_ds_${0..9}.t_user_item_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| item_id| IT.STANDARD.FIXTURE| | item_id| IT.FIXTURE| " />
- <row values="t_user| readwrite_ds_${0..9}.t_user_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | user_id| IT.FIXTURE| " />
- <row values="t_user_details| readwrite_ds_${0..9}.t_user_details_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | " />
- <row values="t_order_item_federate_sharding| readwrite_ds_1.t_order_item_federate_sharding_${0..1}| | | | | | STANDARD| item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}| | | " />
- <row values="t_order_federate_sharding| readwrite_ds_1.t_order_federate_sharding_${0..1}| | | | | | STANDARD| order_id_sharding| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2}| | | " />
- <row values="t_user_encrypt_federate_sharding| readwrite_ds_1.t_user_encrypt_federate_sharding_${0..1}| | | | | | STANDARD| user_id| INLINE| algorithm-expression=t_user_encrypt_federate_sharding_${user_id % 2},allow-range-query-with-inline-sharding=true| | | " />
+ <row values="t_user_item| readwrite_ds_${0..9}.t_user_item_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| item_id| IT.STANDARD.FIXTURE| | item_id| IT.FIXTURE| | IT.AUDITOR.FIXTURE| true" />
+ <row values="t_user| readwrite_ds_${0..9}.t_user_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | user_id| IT.FIXTURE| | IT.AUDITOR.FIXTURE| true" />
+ <row values="t_user_details| readwrite_ds_${0..9}.t_user_details_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | " />
+ <row values="t_order_item_federate_sharding| readwrite_ds_1.t_order_item_federate_sharding_${0..1}| | | | | | STANDARD| item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}| | | | | " />
+ <row values="t_order_federate_sharding| readwrite_ds_1.t_order_federate_sharding_${0..1}| | | | | | STANDARD| order_id_sharding| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2}| | | | | " />
+ <row values="t_user_encrypt_federate_sharding| readwrite_ds_1.t_user_encrypt_federate_sharding_${0..1}| | | | | | STANDARD| user_id| INLINE| algorithm-expression=t_user_encrypt_federate_sharding_${user_id % 2},allow-range-query-with-inline-sharding=true| | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_unused_sharding_auditors.xml
similarity index 100%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_unused_sharding_auditors.xml
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_auditor.xml
similarity index 96%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_auditor.xml
index 8af51b212cc..280c5005039 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_auditor.xml
@@ -17,8 +17,7 @@
<dataset>
<metadata>
- <column name="name" />
<column name="type" />
- <column name="props" />
+ <column name="name" />
</metadata>
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_rule.xml
index ec887a6474f..d464b03c3b3 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_rule.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_rule.xml
@@ -31,5 +31,7 @@
<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>
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_rules.xml
index ec887a6474f..d464b03c3b3 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_rules.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_sharding_table_rules.xml
@@ -31,5 +31,7 @@
<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>
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_unused_sharding_auditors.xml
similarity index 100%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/show_unused_sharding_auditors.xml
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_auditor.xml
similarity index 96%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_auditor.xml
index 8af51b212cc..280c5005039 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_auditor.xml
@@ -17,8 +17,7 @@
<dataset>
<metadata>
- <column name="name" />
<column name="type" />
- <column name="props" />
+ <column name="name" />
</metadata>
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_rule.xml
index 914e60810b4..d448e8e29bb 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_rule.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_rule.xml
@@ -31,6 +31,8 @@
<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_order| write-read-ds.t_order| | | | | | | | | | | | " />
+ <row values="t_order| write-read-ds.t_order| | | | | | | | | | | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_rules.xml
index a5ba6d69a51..de92aae783b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_rules.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_sharding_table_rules.xml
@@ -31,8 +31,10 @@
<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_order| write-read-ds.t_order| | | | | | | | | | | | " />
- <row values="t_order_item| write-read-ds.t_order_item| | | | | | | | | | | | " />
- <row values="t_order_details| write-read-ds.t_order_details| | | | | | | | | | | | " />
+ <row values="t_order| write-read-ds.t_order| | | | | | | | | | | | | | " />
+ <row values="t_order_item| write-read-ds.t_order_item| | | | | | | | | | | | | | " />
+ <row values="t_order_details| write-read-ds.t_order_details| | | | | | | | | | | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_unused_sharding_auditors.xml
similarity index 100%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/show_unused_sharding_auditors.xml
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_auditors.xml
index 8af51b212cc..272eebbe056 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_auditors.xml
@@ -21,4 +21,5 @@
<column name="type" />
<column name="props" />
</metadata>
+ <row values="auditor_constant| IT.AUDITOR.FIXTURE| {}" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_auditor.xml
similarity index 92%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_auditor.xml
index 8af51b212cc..d4a6fdee9de 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_auditor.xml
@@ -17,8 +17,9 @@
<dataset>
<metadata>
- <column name="name" />
<column name="type" />
- <column name="props" />
+ <column name="name" />
</metadata>
+ <row values="table| t_user_item" />
+ <row values="table| t_user" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_rule.xml
index 5c3e2b4881b..c1e4de7ffc1 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_rule.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_rule.xml
@@ -31,6 +31,8 @@
<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| encrypt_ds_${0..9}.t_user_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | user_id| IT.FIXTURE| " />
+ <row values="t_user| encrypt_ds_${0..9}.t_user_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | user_id| IT.FIXTURE| | IT.AUDITOR.FIXTURE| true" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_rules.xml
index 9c2c0a596e8..06e5c53eec1 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_rules.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_sharding_table_rules.xml
@@ -31,11 +31,13 @@
<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_item| encrypt_ds_${0..9}.t_user_item_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| item_id| IT.STANDARD.FIXTURE| | item_id| IT.FIXTURE| " />
- <row values="t_user| encrypt_ds_${0..9}.t_user_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | user_id| IT.FIXTURE| " />
- <row values="t_user_details| encrypt_ds_${0..9}.t_user_details_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | " />
- <row values="t_order_item_federate_sharding| encrypt_ds_1.t_order_item_federate_sharding_${0..1}| | | | | | STANDARD| item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}| | | " />
- <row values="t_order_federate_sharding| encrypt_ds_1.t_order_federate_sharding_${0..1}| | | | | | STANDARD| order_id_sharding| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2}| | | " />
- <row values="t_user_encrypt_federate_sharding| encrypt_ds_1.t_user_encrypt_federate_sharding_${0..1}| | | | | | STANDARD| user_id| INLINE| algorithm-expression=t_user_encrypt_federate_sharding_${user_id % 2},allow-range-query-with-inline-sharding=true| | | " />
+ <row values="t_user_item| encrypt_ds_${0..9}.t_user_item_${0..9}| | STANDARD| user_id| IT.STANDARD.FIXTURE| | STANDARD| item_id| IT.STANDARD.FIXTURE| | item_id| IT.FIXTURE| | IT.AUDITOR.FIXTURE| true" />
+ <row values="t_user| encrypt_ds_${0..9}.t_user_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | user_id| IT.FIXTURE| | IT.AUDITOR.FIXTURE| true" />
+ <row values="t_user_details| encrypt_ds_${0..9}.t_user_details_${0..9}| | STANDARD| address_id| IT.STANDARD.FIXTURE| | STANDARD| user_id| IT.STANDARD.FIXTURE| | | | | | " />
+ <row values="t_order_item_federate_sharding| encrypt_ds_1.t_order_item_federate_sharding_${0..1}| | | | | | STANDARD| item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}| | | | | " />
+ <row values="t_order_federate_sharding| encrypt_ds_1.t_order_federate_sharding_${0..1}| | | | | | STANDARD| order_id_sharding| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2}| | | | | " />
+ <row values="t_user_encrypt_federate_sharding| encrypt_ds_1.t_user_encrypt_federate_sharding_${0..1}| | | | | | STANDARD| user_id| INLINE| algorithm-expression=t_user_encrypt_federate_sharding_${user_id % 2},allow-range-query-with-inline-sharding=true| | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_unused_sharding_auditors.xml
similarity index 100%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_unused_sharding_auditors.xml
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_auditor.xml
similarity index 96%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_auditor.xml
index 8af51b212cc..280c5005039 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_auditor.xml
@@ -17,8 +17,7 @@
<dataset>
<metadata>
- <column name="name" />
<column name="type" />
- <column name="props" />
+ <column name="name" />
</metadata>
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_rule.xml
index 5aeaedcad93..73585dd4726 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_rule.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_rule.xml
@@ -31,6 +31,8 @@
<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_order| governance_db.t_order| | | | | | | | | | | | " />
+ <row values="t_order| governance_db.t_order| | | | | | | | | | | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_rules.xml
index 697281ecb1c..adc9031f540 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_rules.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_sharding_table_rules.xml
@@ -31,7 +31,9 @@
<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_order| governance_db.t_order| | | | | | | | | | | | " />
- <row values="t_order_details| governance_db.t_order_details| | | | | | | | | | | | " />
+ <row values="t_order| governance_db.t_order| | | | | | | | | | | | | | " />
+ <row values="t_order_details| governance_db.t_order_details| | | | | | | | | | | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_unused_sharding_auditors.xml
similarity index 100%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_unused_sharding_auditors.xml
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_auditors.xml
index 8af51b212cc..272eebbe056 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_auditors.xml
@@ -21,4 +21,5 @@
<column name="type" />
<column name="props" />
</metadata>
+ <row values="auditor_constant| IT.AUDITOR.FIXTURE| {}" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_auditor.xml
similarity index 95%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_auditor.xml
index 8af51b212cc..fc16314648b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_sharding_auditors.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_auditor.xml
@@ -17,8 +17,8 @@
<dataset>
<metadata>
- <column name="name" />
<column name="type" />
- <column name="props" />
+ <column name="name" />
</metadata>
+ <row values="table| t_order_item" />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rule.xml
index 8db85eebac2..fa5047656d5 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rule.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rule.xml
@@ -31,6 +31,8 @@
<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_order| tbl.t_order_${0..9}| | | | | | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | " />
+ <row values="t_order| tbl.t_order_${0..9}| | | | | | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rules.xml
index 33a2c090023..09be70f6faf 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rules.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_sharding_table_rules.xml
@@ -31,10 +31,12 @@
<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_order| tbl.t_order_${0..9}| | | | | | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | " />
- <row values="t_order_item| tbl.t_order_item_${0..9}| | | | | | STANDARD| order_id| IT.STANDARD.FIXTURE| | item_id| IT.FIXTURE| " />
- <row values="t_order_details| tbl.t_order_details_${0..9}| | | | | | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | " />
- <row values="t_order_federate_sharding| tbl.t_order_federate_sharding_${0..1}| | | | | | STANDARD| order_id_sharding| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2},allow-range-query-with-inline-sharding=true| | | " />
- <row values="t_order_item_federate_sharding | tbl.t_order_item_federate_sharding_${0..1}| | | | | | STANDARD| item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}| | | " />
+ <row values="t_order| tbl.t_order_${0..9}| | | | | | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | | | " />
+ <row values="t_order_item| tbl.t_order_item_${0..9}| | | | | | STANDARD| order_id| IT.STANDARD.FIXTURE| | item_id| IT.FIXTURE| | IT.AUDITOR.FIXTURE| true" />
+ <row values="t_order_details| tbl.t_order_details_${0..9}| | | | | | STANDARD| order_id| IT.STANDARD.FIXTURE| | | | | | " />
+ <row values="t_order_federate_sharding| tbl.t_order_federate_sharding_${0..1}| | | | | | STANDARD| order_id_sharding| INLINE| algorithm-expression=t_order_federate_sharding_${order_id_sharding % 2},allow-range-query-with-inline-sharding=true| | | | | " />
+ <row values="t_order_item_federate_sharding | tbl.t_order_item_federate_sharding_${0..1}| | | | | | STANDARD| item_id| INLINE| algorithm-expression=t_order_item_federate_sharding_${item_id % 2}| | | | | " />
</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_unused_sharding_auditors.xml
similarity index 100%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/show_sharding_auditors.xml
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/show_unused_sharding_auditors.xml
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 5a2bf7f4d6f..236f7ffb202 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
@@ -60,10 +60,18 @@
<test-case sql="SHOW UNUSED SHARDING KEY GENERATORS" scenario-types="db,tbl,readwrite_splitting,encrypt,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt">
<assertion expected-data-file="show_unused_sharding_generators.xml" />
</test-case>
+
+ <test-case sql="SHOW UNUSED SHARDING AUDITORS" scenario-types="db,tbl,readwrite_splitting,encrypt,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt">
+ <assertion expected-data-file="show_unused_sharding_auditors.xml" />
+ </test-case>
<test-case sql="SHOW SHARDING TABLE RULES USED KEY GENERATOR constant" scenario-types="db,tbl,readwrite_splitting,encrypt,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt">
<assertion expected-data-file="show_sharding_table_generator.xml" />
</test-case>
+
+ <test-case sql="SHOW SHARDING TABLE RULES USED AUDITOR auditor_constant" scenario-types="db,tbl,readwrite_splitting,encrypt,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt">
+ <assertion expected-data-file="show_sharding_table_auditor.xml" />
+ </test-case>
<test-case sql="SHOW DEFAULT SHARDING STRATEGY" scenario-types="db,tbl,readwrite_splitting,encrypt,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,sharding_and_encrypt">
<assertion expected-data-file="show_default_sharding_strategy.xml" />
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/proxy/conf/mysql/config-db.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/proxy/conf/mysql/config-db.yaml
index 791d7ae2868..7c19caa4b2b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/proxy/conf/mysql/config-db.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/proxy/conf/mysql/config-db.yaml
@@ -127,6 +127,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_order_details:
actualDataNodes: ds_${0..9}.t_order_details
databaseStrategy:
@@ -165,3 +169,7 @@ rules:
keyGenerators:
constant:
type: IT.FIXTURE
+
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/proxy/conf/postgresql/config-db.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/proxy/conf/postgresql/config-db.yaml
index ee6de2db9c3..9a0421e92c6 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/proxy/conf/postgresql/config-db.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/proxy/conf/postgresql/config-db.yaml
@@ -127,6 +127,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_order_details:
actualDataNodes: ds_${0..9}.t_order_details
databaseStrategy:
@@ -165,3 +169,7 @@ rules:
keyGenerators:
constant:
type: IT.FIXTURE
+
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
\ No newline at end of file
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/rules.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/rules.yaml
index fa8193bc177..c3d15bef58c 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/rules.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/db/rules.yaml
@@ -33,6 +33,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_order_details:
actualDataNodes: db_${0..9}.t_order_details
databaseStrategy:
@@ -74,5 +78,9 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
props:
sql-federation-type: ADVANCED
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/proxy/conf/mysql/config-dbtbl-with-readwrite-splitting.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/proxy/conf/mysql/config-dbtbl-with-readwrite-splitting.yaml
index d953eec20e6..980d9f74fb7 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/proxy/conf/mysql/config-dbtbl-with-readwrite-splitting.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/proxy/conf/mysql/config-dbtbl-with-readwrite-splitting.yaml
@@ -225,6 +225,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_order_details:
actualDataNodes: readwrite_ds_${0..9}.t_order_details_${0..9}
databaseStrategy:
@@ -267,6 +271,10 @@ rules:
keyGenerators:
constant:
type: IT.FIXTURE
+
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
- !READWRITE_SPLITTING
dataSources:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/proxy/conf/postgresql/config-dbtbl-with-readwrite-splitting.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/proxy/conf/postgresql/config-dbtbl-with-readwrite-splitting.yaml
index 2d7b24606a6..64229c5118c 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/proxy/conf/postgresql/config-dbtbl-with-readwrite-splitting.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/proxy/conf/postgresql/config-dbtbl-with-readwrite-splitting.yaml
@@ -225,6 +225,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_order_details:
actualDataNodes: readwrite_ds_${0..9}.t_order_details_${0..9}
databaseStrategy:
@@ -267,6 +271,10 @@ rules:
keyGenerators:
constant:
type: IT.FIXTURE
+
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
- !READWRITE_SPLITTING
dataSources:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/rules.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/rules.yaml
index 770b65343ff..effa6a9feb5 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/rules.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting/rules.yaml
@@ -41,6 +41,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_order_details:
actualDataNodes: readwrite_ds_${0..9}.t_order_details_${0..9}
databaseStrategy:
@@ -84,6 +88,10 @@ rules:
keyGenerators:
constant:
type: IT.FIXTURE
+
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
- !READWRITE_SPLITTING
dataSources:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/mysql/config-dbtbl-with-readwrite-splitting-and-encrypt.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/mysql/config-dbtbl-with-readwrite-splitting-and-encrypt.yaml
index 33b53132bb3..d7ed428d961 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/mysql/config-dbtbl-with-readwrite-splitting-and-encrypt.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/mysql/config-dbtbl-with-readwrite-splitting-and-encrypt.yaml
@@ -215,6 +215,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user:
actualDataNodes: readwrite_ds_${0..9}.t_user_${0..9}
databaseStrategy:
@@ -228,6 +232,10 @@ rules:
keyGenerateStrategy:
column: user_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user_details:
actualDataNodes: readwrite_ds_${0..9}.t_user_details_${0..9}
databaseStrategy:
@@ -280,6 +288,10 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
- !READWRITE_SPLITTING
dataSources:
readwrite_ds_0:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/postgresql/config-dbtbl-with-readwrite-splitting-and-encrypt.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/postgresql/config-dbtbl-with-readwrite-splitting-and-encrypt.yaml
index d915402d59e..54406919817 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/postgresql/config-dbtbl-with-readwrite-splitting-and-encrypt.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/proxy/conf/postgresql/config-dbtbl-with-readwrite-splitting-and-encrypt.yaml
@@ -215,6 +215,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user:
actualDataNodes: readwrite_ds_${0..9}.t_user_${0..9}
databaseStrategy:
@@ -228,6 +232,10 @@ rules:
keyGenerateStrategy:
column: user_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user_details:
actualDataNodes: readwrite_ds_${0..9}.t_user_details_${0..9}
databaseStrategy:
@@ -280,6 +288,10 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
- !READWRITE_SPLITTING
dataSources:
readwrite_ds_0:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/rules.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/rules.yaml
index 1d1f23db0c8..aafec344284 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/rules.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/dbtbl_with_readwrite_splitting_and_encrypt/rules.yaml
@@ -44,6 +44,10 @@ rules:
keyGenerateStrategy:
column: user_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user_details:
actualDataNodes: readwrite_ds_${0..9}.t_user_details_${0..9}
databaseStrategy:
@@ -96,6 +100,10 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
- !READWRITE_SPLITTING
dataSources:
readwrite_ds_0:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/empty_rules/proxy/conf/mysql/config-empty-rules.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/empty_rules/proxy/conf/mysql/config-empty-rules.yaml
index 26df88ba59c..57f56dd2877 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/empty_rules/proxy/conf/mysql/config-empty-rules.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/empty_rules/proxy/conf/mysql/config-empty-rules.yaml
@@ -220,6 +220,10 @@ rules:
keyGenerateStrategy:
column: user_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user_item:
actualDataSources: write_ds_${0..9}
shardingStrategy:
@@ -240,6 +244,10 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
- !READWRITE_SPLITTING
dataSources:
readwrite_ds_0:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/empty_rules/proxy/conf/postgresql/config-empty-rules.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/empty_rules/proxy/conf/postgresql/config-empty-rules.yaml
index 6f0b6724fe0..8b830475ced 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/empty_rules/proxy/conf/postgresql/config-empty-rules.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/empty_rules/proxy/conf/postgresql/config-empty-rules.yaml
@@ -220,6 +220,10 @@ rules:
keyGenerateStrategy:
column: user_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user_item:
actualDataSources: write_ds_${0..9}
shardingStrategy:
@@ -240,6 +244,10 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
- !READWRITE_SPLITTING
dataSources:
readwrite_ds_0:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/mysql/config-sharding-and-encrypt.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/mysql/config-sharding-and-encrypt.yaml
index 26c0f64df72..7b9afda91ae 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/mysql/config-sharding-and-encrypt.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/mysql/config-sharding-and-encrypt.yaml
@@ -125,6 +125,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user:
actualDataNodes: encrypt_ds_${0..9}.t_user_${0..9}
databaseStrategy:
@@ -138,6 +142,10 @@ rules:
keyGenerateStrategy:
column: user_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user_details:
actualDataNodes: encrypt_ds_${0..9}.t_user_details_${0..9}
databaseStrategy:
@@ -190,6 +198,10 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
- !ENCRYPT
encryptors:
aes_encryptor:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/postgresql/config-sharding-and-encrypt.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/postgresql/config-sharding-and-encrypt.yaml
index 923deea601d..1ba71e1b2b9 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/postgresql/config-sharding-and-encrypt.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/proxy/conf/postgresql/config-sharding-and-encrypt.yaml
@@ -125,6 +125,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user:
actualDataNodes: encrypt_ds_${0..9}.t_user_${0..9}
databaseStrategy:
@@ -138,6 +142,10 @@ rules:
keyGenerateStrategy:
column: user_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user_details:
actualDataNodes: encrypt_ds_${0..9}.t_user_details_${0..9}
databaseStrategy:
@@ -190,6 +198,10 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
- !ENCRYPT
encryptors:
aes_encryptor:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/rules.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/rules.yaml
index f7f6e2d39a3..56e70c10d43 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/rules.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/sharding_and_encrypt/rules.yaml
@@ -31,6 +31,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user:
actualDataNodes: encrypt_ds_${0..9}.t_user_${0..9}
databaseStrategy:
@@ -44,6 +48,10 @@ rules:
keyGenerateStrategy:
column: user_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_user_details:
actualDataNodes: encrypt_ds_${0..9}.t_user_details_${0..9}
databaseStrategy:
@@ -96,6 +104,10 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
- !ENCRYPT
encryptors:
aes_encryptor:
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/proxy/conf/mysql/config-tbl.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/proxy/conf/mysql/config-tbl.yaml
index 76d16abe9bf..d982fd1a244 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/proxy/conf/mysql/config-tbl.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/proxy/conf/mysql/config-tbl.yaml
@@ -46,6 +46,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_order_details:
actualDataNodes: tbl.t_order_details_${0..9}
tableStrategy:
@@ -86,3 +90,7 @@ rules:
keyGenerators:
constant:
type: IT.FIXTURE
+
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/proxy/conf/postgresql/config-tbl.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/proxy/conf/postgresql/config-tbl.yaml
index 28e160b6ba7..3276118a239 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/proxy/conf/postgresql/config-tbl.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/proxy/conf/postgresql/config-tbl.yaml
@@ -46,6 +46,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_order_details:
actualDataNodes: tbl.t_order_details_${0..9}
tableStrategy:
@@ -86,3 +90,7 @@ rules:
keyGenerators:
constant:
type: IT.FIXTURE
+
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/rules.yaml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/rules.yaml
index 19631e7b79c..6abc203966d 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/rules.yaml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/env/scenario/tbl/rules.yaml
@@ -33,6 +33,10 @@ rules:
keyGenerateStrategy:
column: item_id
keyGeneratorName: constant
+ auditStrategy:
+ auditorNames:
+ - auditor_constant
+ allowHintDisable: true
t_order_details:
actualDataNodes: tbl.t_order_details_${0..9}
tableStrategy:
@@ -74,5 +78,9 @@ rules:
constant:
type: IT.FIXTURE
+ auditors:
+ auditor_constant:
+ type: IT.AUDITOR.FIXTURE
+
props:
sql-federation-type: ADVANCED