You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/12/25 06:16:16 UTC

[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #23086: Add IF NOT EXISTS to CREATE SHADOW RULE.

RaigorJiang commented on code in PR #23086:
URL: https://github.com/apache/shardingsphere/pull/23086#discussion_r1056905955


##########
features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/update/CreateShadowRuleStatementUpdater.java:
##########
@@ -66,17 +68,23 @@ private void updateTables(final Map<String, ShadowTableConfiguration> currentTab
     public void checkSQLStatement(final ShardingSphereDatabase database, final CreateShadowRuleStatement sqlStatement, final ShadowRuleConfiguration currentRuleConfig) {
         String databaseName = database.getName();
         Collection<ShadowRuleSegment> rules = sqlStatement.getRules();
-        checkRuleNames(databaseName, rules, currentRuleConfig);
+        checkRuleNames(databaseName, sqlStatement, currentRuleConfig);
         checkResources(database, rules);
-        checkAlgorithms(databaseName, sqlStatement.getRules());
-        checkAlgorithmType(sqlStatement);
+        checkAlgorithms(databaseName, rules);
+        checkAlgorithmType(rules);
     }
     
-    private void checkRuleNames(final String databaseName, final Collection<ShadowRuleSegment> rules, final ShadowRuleConfiguration currentRuleConfig) {
-        Collection<String> requireRuleNames = ShadowRuleStatementSupporter.getRuleNames(rules);
+    private void checkRuleNames(final String databaseName, final CreateShadowRuleStatement sqlStatement, final ShadowRuleConfiguration currentRuleConfig) {
+        Collection<String> requireRuleNames = ShadowRuleStatementSupporter.getRuleNames(sqlStatement.getRules());

Review Comment:
   Does the requireRuleNames mean toBeCreatedRuleNames?



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org