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 2021/02/01 07:03:21 UTC
[GitHub] [shardingsphere] jingshanglu opened a new pull request #9245: fix #9168
jingshanglu opened a new pull request #9245:
URL: https://github.com/apache/shardingsphere/pull/9245
Fixes #9168.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero merged pull request #9245: fix #9168
Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #9245:
URL: https://github.com/apache/shardingsphere/pull/9245
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero commented on a change in pull request #9245: fix #9168
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #9245:
URL: https://github.com/apache/shardingsphere/pull/9245#discussion_r568288473
##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/AlterShardingRuleBackendHandler.java
##########
@@ -118,8 +118,14 @@ private void checkAddRule(final ShardingRuleConfiguration shardingRuleConfig, fi
private void alter(final YamlShardingRuleConfiguration yamlShardingRuleConfig, final AlterShardingRuleStatement statement) {
modifyTableRule(yamlShardingRuleConfig, statement);
addTableRule(yamlShardingRuleConfig, statement);
- if (!statement.getBindingTables().isEmpty()) {
- yamlShardingRuleConfig.setBindingTables(statement.getBindingTables());
+ Collection<String> existBindingTables = yamlShardingRuleConfig.getBindingTables();
Review comment:
Is there any judgement for no such binding_table_rule?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero commented on a change in pull request #9245: fix #9168
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #9245:
URL: https://github.com/apache/shardingsphere/pull/9245#discussion_r568288473
##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/AlterShardingRuleBackendHandler.java
##########
@@ -118,8 +118,14 @@ private void checkAddRule(final ShardingRuleConfiguration shardingRuleConfig, fi
private void alter(final YamlShardingRuleConfiguration yamlShardingRuleConfig, final AlterShardingRuleStatement statement) {
modifyTableRule(yamlShardingRuleConfig, statement);
addTableRule(yamlShardingRuleConfig, statement);
- if (!statement.getBindingTables().isEmpty()) {
- yamlShardingRuleConfig.setBindingTables(statement.getBindingTables());
+ Collection<String> existBindingTables = yamlShardingRuleConfig.getBindingTables();
Review comment:
Is there any judgement for no such binding_table_rule?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #9245: fix #9168
Posted by GitBox <gi...@apache.org>.
jingshanglu commented on a change in pull request #9245:
URL: https://github.com/apache/shardingsphere/pull/9245#discussion_r568299524
##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/AlterShardingRuleBackendHandler.java
##########
@@ -118,8 +118,14 @@ private void checkAddRule(final ShardingRuleConfiguration shardingRuleConfig, fi
private void alter(final YamlShardingRuleConfiguration yamlShardingRuleConfig, final AlterShardingRuleStatement statement) {
modifyTableRule(yamlShardingRuleConfig, statement);
addTableRule(yamlShardingRuleConfig, statement);
- if (!statement.getBindingTables().isEmpty()) {
- yamlShardingRuleConfig.setBindingTables(statement.getBindingTables());
+ Collection<String> existBindingTables = yamlShardingRuleConfig.getBindingTables();
+ for (String each : statement.getAddBindingTables()) {
+ if (!existBindingTables.contains(each)) {
+ existBindingTables.add(each);
+ }
+ }
+ for (String each : statement.getDropBindingTables()) {
+ existBindingTables.remove(each);
Review comment:
@tristaZero
There's no need to judge.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #9245: fix #9168
Posted by GitBox <gi...@apache.org>.
jingshanglu commented on a change in pull request #9245:
URL: https://github.com/apache/shardingsphere/pull/9245#discussion_r568299524
##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/AlterShardingRuleBackendHandler.java
##########
@@ -118,8 +118,14 @@ private void checkAddRule(final ShardingRuleConfiguration shardingRuleConfig, fi
private void alter(final YamlShardingRuleConfiguration yamlShardingRuleConfig, final AlterShardingRuleStatement statement) {
modifyTableRule(yamlShardingRuleConfig, statement);
addTableRule(yamlShardingRuleConfig, statement);
- if (!statement.getBindingTables().isEmpty()) {
- yamlShardingRuleConfig.setBindingTables(statement.getBindingTables());
+ Collection<String> existBindingTables = yamlShardingRuleConfig.getBindingTables();
+ for (String each : statement.getAddBindingTables()) {
+ if (!existBindingTables.contains(each)) {
+ existBindingTables.add(each);
+ }
+ }
+ for (String each : statement.getDropBindingTables()) {
+ existBindingTables.remove(each);
Review comment:
@tristaZero
There's no need to judge.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org