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/02/25 09:51:11 UTC
[GitHub] [shardingsphere] lanchengx opened a new pull request #15635: `DROP ENCRYPT` syntax adds `IF EXISTS` keyword.
lanchengx opened a new pull request #15635:
URL: https://github.com/apache/shardingsphere/pull/15635
For https://github.com/apache/shardingsphere/pull/15617
Changes proposed in this pull request:
- Add `IF EXISTS` keyword
**Test**
<img width="598" alt="image" src="https://user-images.githubusercontent.com/52209337/155693781-f925f133-d234-41b7-ac0d-11fbb3050f69.png">
--
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 change in pull request #15635: `DROP ENCRYPT` syntax adds `IF EXISTS` keyword.
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on a change in pull request #15635:
URL: https://github.com/apache/shardingsphere/pull/15635#discussion_r814657076
##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/distsql/update/RuleDefinitionDropUpdater.java
##########
@@ -33,7 +36,40 @@
*
* @param sqlStatement SQL statement
* @param currentRuleConfig current rule configuration to be updated
- * @return current rule configuration is empty or not
+ * @return current rule configuration is empty or not
*/
boolean updateCurrentRuleConfiguration(T sqlStatement, R currentRuleConfig);
+
+ /**
+ * Whether there is dropped configuration.
Review comment:
This comment does not match the method name.
--
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 #15635: `DROP ENCRYPT` syntax adds `IF EXISTS` keyword.
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #15635:
URL: https://github.com/apache/shardingsphere/pull/15635#issuecomment-1053897433
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/15635?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 [#15635](https://codecov.io/gh/apache/shardingsphere/pull/15635?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b1e94c7) into [master](https://codecov.io/gh/apache/shardingsphere/commit/7a322361a463b6b2e23c66c22eba77f4519d44d9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7a32236) will **increase** coverage by `0.00%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/15635/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/15635?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #15635 +/- ##
=========================================
Coverage 60.42% 60.42%
- Complexity 1763 1766 +3
=========================================
Files 3242 3248 +6
Lines 48823 48903 +80
Branches 8345 8360 +15
=========================================
+ Hits 29499 29550 +51
- Misses 16900 16922 +22
- Partials 2424 2431 +7
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/15635?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ql/parser/core/EncryptDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLXBhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZW5jcnlwdC9kaXN0c3FsL3BhcnNlci9jb3JlL0VuY3J5cHREaXN0U1FMU3RhdGVtZW50VmlzaXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...sql/parser/statement/DropEncryptRuleStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZW5jcnlwdC9kaXN0c3FsL3BhcnNlci9zdGF0ZW1lbnQvRHJvcEVuY3J5cHRSdWxlU3RhdGVtZW50LmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...nfra/distsql/update/RuleDefinitionDropUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9kaXN0c3FsL3VwZGF0ZS9SdWxlRGVmaW5pdGlvbkRyb3BVcGRhdGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...sql/rdl/drop/DropEncryptRuleStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2Rpc3RzcWwvcmRsL2Ryb3AvRHJvcEVuY3J5cHRSdWxlU3RhdGVtZW50VGVzdENhc2UuamF2YQ==) | `100.00% <ø> (ø)` | |
| [...distsql/rdl/rule/RuleDefinitionBackendHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmRsL3J1bGUvUnVsZURlZmluaXRpb25CYWNrZW5kSGFuZGxlci5qYXZh) | `56.33% <62.50%> (-0.59%)` | :arrow_down: |
| [...andler/update/DropEncryptRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvZGlzdHNxbC9oYW5kbGVyL3VwZGF0ZS9Ecm9wRW5jcnlwdFJ1bGVTdGF0ZW1lbnRVcGRhdGVyLmphdmE=) | `74.19% <75.00%> (+0.86%)` | :arrow_up: |
| [...kend/response/header/query/QueryHeaderBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9yZXNwb25zZS9oZWFkZXIvcXVlcnkvUXVlcnlIZWFkZXJCdWlsZGVyLmphdmE=) | `87.50% <0.00%> (-12.50%)` | :arrow_down: |
| [...r/jdbc/core/resultset/ShardingSphereResultSet.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RyaXZlci9qZGJjL2NvcmUvcmVzdWx0c2V0L1NoYXJkaW5nU3BoZXJlUmVzdWx0U2V0LmphdmE=) | `90.62% <0.00%> (-4.38%)` | :arrow_down: |
| [.../db/protocol/mysql/constant/MySQLCharacterSet.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wvc2hhcmRpbmdzcGhlcmUtZGItcHJvdG9jb2wtbXlzcWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RiL3Byb3RvY29sL215c3FsL2NvbnN0YW50L015U1FMQ2hhcmFjdGVyU2V0LmphdmE=) | `98.02% <0.00%> (-0.98%)` | :arrow_down: |
| [...nse/header/query/impl/MySQLQueryHeaderBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/15635/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9yZXNwb25zZS9oZWFkZXIvcXVlcnkvaW1wbC9NeVNRTFF1ZXJ5SGVhZGVyQnVpbGRlci5qYXZh) | `80.00% <0.00%> (-0.96%)` | :arrow_down: |
| ... and [35 more](https://codecov.io/gh/apache/shardingsphere/pull/15635/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/15635?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/15635?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7a32236...b1e94c7](https://codecov.io/gh/apache/shardingsphere/pull/15635?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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
[GitHub] [shardingsphere] RaigorJiang commented on a change in pull request #15635: `DROP ENCRYPT` syntax adds `IF EXISTS` keyword.
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on a change in pull request #15635:
URL: https://github.com/apache/shardingsphere/pull/15635#discussion_r814657436
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/update/DropEncryptRuleStatementUpdater.java
##########
@@ -68,10 +68,12 @@ public boolean updateCurrentRuleConfiguration(final DropEncryptRuleStatement sql
private void dropRule(final EncryptRuleConfiguration currentRuleConfig, final String ruleName) {
Optional<EncryptTableRuleConfiguration> encryptTableRuleConfig = currentRuleConfig.getTables().stream().filter(tableRule -> tableRule.getName().equals(ruleName)).findAny();
- Preconditions.checkState(encryptTableRuleConfig.isPresent());
- currentRuleConfig.getTables().remove(encryptTableRuleConfig.get());
- encryptTableRuleConfig.get().getColumns().stream().filter(column -> !isEncryptorInUse(currentRuleConfig, column.getEncryptorName()))
- .forEach(column -> currentRuleConfig.getEncryptors().remove(column.getEncryptorName()));
+ encryptTableRuleConfig.ifPresent(op -> {
+ currentRuleConfig.getTables().remove(encryptTableRuleConfig.get());
+ encryptTableRuleConfig.get().getColumns().stream().filter(column -> !isEncryptorInUse(currentRuleConfig, column.getEncryptorName()))
+ .forEach(column -> currentRuleConfig.getEncryptors().remove(column.getEncryptorName()));
+
Review comment:
Blank line.
--
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 #15635: `DROP ENCRYPT` syntax adds `IF EXISTS` keyword.
Posted by GitBox <gi...@apache.org>.
RaigorJiang merged pull request #15635:
URL: https://github.com/apache/shardingsphere/pull/15635
--
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