RaigorJiang commented on code in PR #23098:
URL: https://github.com/apache/shardingsphere/pull/23098#discussion_r1057120455
##########
features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/update/CreateShardingTableReferenceRuleStatementUpdater.java:
##########
@@ -35,18 +35,24 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
+import java.util.LinkedList;
import java.util.stream.Collectors;
/**
* Create sharding table reference rule statement updater.
*/
public final class CreateShardingTableReferenceRuleStatementUpdater implements
RuleDefinitionCreateUpdater<CreateShardingTableReferenceRuleStatement,
ShardingRuleConfiguration> {
+ private boolean ifNotExists;
+
@Override
public void checkSQLStatement(final ShardingSphereDatabase database, final
CreateShardingTableReferenceRuleStatement sqlStatement, final
ShardingRuleConfiguration currentRuleConfig) {
String databaseName = database.getName();
+ ifNotExists = sqlStatement.isIfNotExists();
checkCurrentRuleConfiguration(databaseName, currentRuleConfig);
- checkDuplicateRuleNames(databaseName, sqlStatement, currentRuleConfig);
+ if (!ifNotExists) {
+ checkDuplicateRuleNames(databaseName, sqlStatement,
currentRuleConfig);
Review Comment:
Please rename `Duplicate` to `Duplicated`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]