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/22 07:21:33 UTC
[GitHub] [shardingsphere] gxxiong opened a new pull request, #23030: Like query algorithm support '_' match
gxxiong opened a new pull request, #23030:
URL: https://github.com/apache/shardingsphere/pull/23030
Fixes #23029 .
Changes proposed in this pull request:
-Like query algorithm support '_' match
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`.
- [X] 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] codecov-commenter commented on pull request #23030: Like query algorithm support '_' match
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #23030:
URL: https://github.com/apache/shardingsphere/pull/23030#issuecomment-1362525096
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/23030?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 [#23030](https://codecov.io/gh/apache/shardingsphere/pull/23030?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f6b0abe) into [master](https://codecov.io/gh/apache/shardingsphere/commit/2e2067d9a20a82aedb6cb327f909619dfe505d65?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2e2067d) will **decrease** coverage by `0.00%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## master #23030 +/- ##
============================================
- Coverage 50.05% 50.05% -0.01%
Complexity 2428 2428
============================================
Files 4110 4110
Lines 57341 57339 -2
Branches 9041 9040 -1
============================================
- Hits 28701 28699 -2
Misses 26133 26133
Partials 2507 2507
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/23030?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...algorithm/like/CharDigestLikeEncryptAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/23030/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-ZmVhdHVyZXMvZW5jcnlwdC9jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9lbmNyeXB0L2FsZ29yaXRobS9saWtlL0NoYXJEaWdlc3RMaWtlRW5jcnlwdEFsZ29yaXRobS5qYXZh) | `70.90% <100.00%> (-1.03%)` | :arrow_down: |
: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
[GitHub] [shardingsphere] gxxiong commented on a diff in pull request #23030: Like query algorithm support '_' match
Posted by GitBox <gi...@apache.org>.
gxxiong commented on code in PR #23030:
URL: https://github.com/apache/shardingsphere/pull/23030#discussion_r1055169859
##########
features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java:
##########
@@ -154,17 +154,13 @@ private String digest(final String plainValue) {
StringBuilder result = new StringBuilder(plainValue.length());
for (char each : plainValue.toCharArray()) {
char maskedChar = getMaskedChar(each);
- if ('%' == maskedChar) {
Review Comment:
The getMaskedChar function returns % or _ directly
##########
docs/document/content/features/encrypt/limitations.cn.md:
##########
@@ -4,6 +4,7 @@ weight = 2
+++
- 需自行处理数据库中原始的存量数据;
+- 模糊查询支持%、_,暂不支持escape;
Review Comment:
ok
--
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] strongduanmu merged pull request #23030: Like query algorithm support '_' match
Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #23030:
URL: https://github.com/apache/shardingsphere/pull/23030
--
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] strongduanmu commented on a diff in pull request #23030: Like query algorithm support '_' match
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #23030:
URL: https://github.com/apache/shardingsphere/pull/23030#discussion_r1055166723
##########
features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java:
##########
@@ -154,17 +154,13 @@ private String digest(final String plainValue) {
StringBuilder result = new StringBuilder(plainValue.length());
for (char each : plainValue.toCharArray()) {
char maskedChar = getMaskedChar(each);
- if ('%' == maskedChar) {
Review Comment:
If the result of the mask operation is % or _, should we keep the original character?
##########
docs/document/content/features/encrypt/limitations.cn.md:
##########
@@ -4,6 +4,7 @@ weight = 2
+++
- 需自行处理数据库中原始的存量数据;
+- 模糊查询支持%、_,暂不支持escape;
Review Comment:
Please add a space between chinese characters and symbols(or english word).
##########
features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithmTest.java:
##########
@@ -58,6 +58,8 @@ private Properties createProperties() {
public void assertEncrypt() {
assertThat(englishLikeEncryptAlgorithm.encrypt("1234567890%abcdefghijklmnopqrstuvwxyz%ABCDEFGHIJKLMNOPQRSTUVWXYZ",
mock(EncryptContext.class)), is("0145458981%`adedehihilmlmpqpqtutuxyxy%@ADEDEHIHILMLMPQPQTUTUXYXY"));
+ assertThat(englishLikeEncryptAlgorithm.encrypt("_1234__5678__",
+ mock(EncryptContext.class)), is("_0145__4589__"));
Review Comment:
Can you add integration test for `_` support?
--
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] gxxiong commented on a diff in pull request #23030: Like query algorithm support '_' match
Posted by GitBox <gi...@apache.org>.
gxxiong commented on code in PR #23030:
URL: https://github.com/apache/shardingsphere/pull/23030#discussion_r1055170025
##########
features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithmTest.java:
##########
@@ -58,6 +58,8 @@ private Properties createProperties() {
public void assertEncrypt() {
assertThat(englishLikeEncryptAlgorithm.encrypt("1234567890%abcdefghijklmnopqrstuvwxyz%ABCDEFGHIJKLMNOPQRSTUVWXYZ",
mock(EncryptContext.class)), is("0145458981%`adedehihilmlmpqpqtutuxyxy%@ADEDEHIHILMLMPQPQTUTUXYXY"));
+ assertThat(englishLikeEncryptAlgorithm.encrypt("_1234__5678__",
+ mock(EncryptContext.class)), is("_0145__4589__"));
Review Comment:
ok
--
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