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/26 06:54:04 UTC
[GitHub] [shardingsphere] Qianyi951015 opened a new pull request, #23098: Add `IF NOT EXISTS` to `create sharding table reference rule`
Qianyi951015 opened a new pull request, #23098:
URL: https://github.com/apache/shardingsphere/pull/23098
The third task of #22844.
Changes proposed in this pull request:
- Add `IF NOT EXISTS` to `create sharding table reference rule`
---
Before committing this PR, I'm sure that I have checked the following options:
- [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [x] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the pull request.
- [x] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
- [ ] I have made corresponding changes to the documentation.
- [x] I have added corresponding unit tests for my changes.
--
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
[GitHub] [shardingsphere] RaigorJiang merged pull request #23098: Add `IF NOT EXISTS` to `create sharding table reference rule`
Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #23098:
URL: https://github.com/apache/shardingsphere/pull/23098
--
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
[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #23098: Add `IF NOT EXISTS` to `create sharding table reference rule`
Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter commented on pull request #23098: Add `IF NOT EXISTS` to `create sharding table reference rule`
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #23098:
URL: https://github.com/apache/shardingsphere/pull/23098#issuecomment-1364958610
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/23098?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#23098](https://codecov.io/gh/apache/shardingsphere/pull/23098?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eed973c) into [master](https://codecov.io/gh/apache/shardingsphere/commit/440536943ccad254425c25aadb1b491ffd9d1670?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4405369) will **increase** coverage by `0.04%`.
> The diff coverage is `70.00%`.
```diff
@@ Coverage Diff @@
## master #23098 +/- ##
============================================
+ Coverage 49.93% 49.97% +0.04%
- Complexity 2422 2433 +11
============================================
Files 4112 4112
Lines 57490 57498 +8
Branches 9084 9088 +4
============================================
+ Hits 28708 28736 +28
+ Misses 26269 26250 -19
+ Partials 2513 2512 -1
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/23098?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...l/parser/core/ShardingDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/23098/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvc2hhcmRpbmcvZGlzdHNxbC9wYXJzZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NoYXJkaW5nL2Rpc3RzcWwvcGFyc2VyL2NvcmUvU2hhcmRpbmdEaXN0U1FMU3RhdGVtZW50VmlzaXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ent/CreateShardingTableReferenceRuleStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/23098/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvc2hhcmRpbmcvZGlzdHNxbC9zdGF0ZW1lbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NoYXJkaW5nL2Rpc3RzcWwvcGFyc2VyL3N0YXRlbWVudC9DcmVhdGVTaGFyZGluZ1RhYmxlUmVmZXJlbmNlUnVsZVN0YXRlbWVudC5qYXZh) | `0.00% <ø> (ø)` | |
| [...ateShardingTableReferenceRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/23098/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvc2hhcmRpbmcvZGlzdHNxbC9oYW5kbGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFyZGluZy9kaXN0c3FsL2hhbmRsZXIvdXBkYXRlL0NyZWF0ZVNoYXJkaW5nVGFibGVSZWZlcmVuY2VSdWxlU3RhdGVtZW50VXBkYXRlci5qYXZh) | `82.00% <77.77%> (+24.85%)` | :arrow_up: |
| [...ler/checker/ShardingTableRuleStatementChecker.java](https://codecov.io/gh/apache/shardingsphere/pull/23098/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvc2hhcmRpbmcvZGlzdHNxbC9oYW5kbGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFyZGluZy9kaXN0c3FsL2hhbmRsZXIvY2hlY2tlci9TaGFyZGluZ1RhYmxlUnVsZVN0YXRlbWVudENoZWNrZXIuamF2YQ==) | `86.72% <0.00%> (+3.31%)` | :arrow_up: |
| [...handler/distsql/ral/hint/enums/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/23098/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9oYW5kbGVyL2Rpc3RzcWwvcmFsL2hpbnQvZW51bXMvSGludFNvdXJjZVR5cGUuamF2YQ==) | `42.85% <0.00%> (+42.85%)` | :arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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