You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "FakeKotaro (via GitHub)" <gi...@apache.org> on 2023/05/25 10:56:43 UTC

[GitHub] [shardingsphere] FakeKotaro opened a new issue, #25892: use of the operator '||' cannot be rewritten correctly in where clause in encryption

FakeKotaro opened a new issue, #25892:
URL: https://github.com/apache/shardingsphere/issues/25892

   ### Which version of ShardingSphere did you use?
   ShardingSphere-JDBC 
   5.3.2
   
   ### Description
   I use the encryption module to rewrite the sql
   My config (Encryption rules section):
   ```yaml
   rules:
   - !ENCRYPT
       encryptors:
         encryptor-aes:
           props:
             aes-key-value: 123456a
           type: AES
       tables:
         user:
           columns:
             name:
               plainColumn: name
               cipherColumn: name_encode
               encryptorName: encryptor-aes
             phone:
               plainColumn: phone
               cipherColumn: phone_encode
               encryptorName: encryptor-aes
   ```
   When I execute this sql:
   ```sql
   SELECT 1 FROM user WHERE phone = '123' AND name = 'devin' || name = 'devin2'
   ```
   This sql is expected to be rewritten to result in:
   ```sql
   SELECT 1 FROM user WHERE phone_encode ='xxx' AND name_encode = 'xxx' || name_encode = 'xxx'
   ```
   I use xxx to represent the cipher text
   
   But the  actual rewritten sql is
   ```sql
   SELECT 1 FROM user WHERE phone_encode = 'xxx' AND name = 'devin' || name = 'devin2'
   ```
   **column name should be rewritten as name_encode = 'xxx', but it is not**
   
   After debugging, I found that '||' does not seem to be parsed as a CommonToken


-- 
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.apache.org

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


[GitHub] [shardingsphere] sandynz commented on issue #25892: use of the operator '||' cannot be rewritten correctly in where clause in encryption

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #25892:
URL: https://github.com/apache/shardingsphere/issues/25892#issuecomment-1563704192

   Hi @FakeKotaro , thanks for your feedback. Would you like try to submit a PR to resolve it?


-- 
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 issue #25892: use of the operator '||' cannot be rewritten correctly in where clause in encryption

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #25892:
URL: https://github.com/apache/shardingsphere/issues/25892#issuecomment-1741705081

   Hi @zihaoAK47, thank you for your contribution. Assigned.


-- 
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] zihaoAK47 commented on issue #25892: use of the operator '||' cannot be rewritten correctly in where clause in encryption

Posted by "zihaoAK47 (via GitHub)" <gi...@apache.org>.
zihaoAK47 commented on issue #25892:
URL: https://github.com/apache/shardingsphere/issues/25892#issuecomment-1740895700

   @strongduanmu  Hi mentor, please assign the questions to me. Thank you


-- 
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] sandynz commented on issue #25892: use of the operator '||' cannot be rewritten correctly in where clause in encryption

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #25892:
URL: https://github.com/apache/shardingsphere/issues/25892#issuecomment-1563821641

   @FakeKotaro , Nice. Assigned to you.


-- 
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] github-actions[bot] commented on issue #25892: use of the operator '||' cannot be rewritten correctly in where clause in encryption

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #25892:
URL: https://github.com/apache/shardingsphere/issues/25892#issuecomment-1712169433

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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] FakeKotaro commented on issue #25892: use of the operator '||' cannot be rewritten correctly in where clause in encryption

Posted by "FakeKotaro (via GitHub)" <gi...@apache.org>.
FakeKotaro commented on issue #25892:
URL: https://github.com/apache/shardingsphere/issues/25892#issuecomment-1563719817

   > Hi @FakeKotaro , thanks for your feedback. Would you like try to submit a PR to resolve it?
   
   Ok, I will try to solve the problem and submit a PR


-- 
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 closed issue #25892: use of the operator '||' cannot be rewritten correctly in where clause in encryption

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu closed issue #25892: use of the operator '||' cannot be rewritten correctly in where clause in encryption 
URL: https://github.com/apache/shardingsphere/issues/25892


-- 
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