You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "ShcRes (via GitHub)" <gi...@apache.org> on 2024/07/25 06:50:26 UTC

[I] fuzzy query with encrypt isn't support like operate with escape [shardingsphere]

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

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.5.0
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   Logic SQL: 
   ```sql
    select * from table where cipher_column like ? escape ?;
   ```
   Excepted after encrypt operate SQL:
   ```sql
    select * from table where likequery_column like ? escape ?;
   ```
   ### Actual behavior
   Actual  after encrypt operate SQL: 
   ```sql
   select * from table where likequery_column like ?;
   ```
   
   ‘escape ?’ lost and number of parameters is 2  then Parameter index out of range (2 > number of parameters, which is 1)
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   1. rule configuration
   ```yaml
   mode:
     type: Standalone
     repository:
       type: JDBC
   rules:
     - !SINGLE
       tables:
         - ds_1.*
     - !ENCRYPT
       tables:
         pe_table:
           columns:
             card_no:
               cipher:
                 name: card_no
                 encryptorName: aes_encryptor
               likeQuery:
                 name: card_no_like
                 encryptorName: like_encryptor
       encryptors:
         aes_encryptor:
           type: AES
           props:
             aes-key-value: 123456abc
         like_encryptor:
           type: CHAR_DIGEST_LIKE
   ```
   2. exception
   **sql-paramaters:  [828081a78f763fb3018f7640e664000b, %xxx%, \\, 20]**
   ```sql
   -- Logic SQL:
    select 
         petable0_.id,  petable0_.card_no
    from pe_table petable0_
    where petable0_.fk_batch_id=? 
         and (petable0_.card_no like ? escape ?) order by petable0_.id desc limit ?
   ```
   ```sql
   -- Actual SQL:
    select 
         petable0_.id, petable0_.card_no
    from pe_table petable0_ 
    where petable0_.fk_batch_id=? 
          and (petable0_.card_no_like like ?) 
     order by petable0_.id desc limit ?
   ```
   ![image](https://github.com/user-attachments/assets/ffc3b457-e18f-4443-bd37-15cccb5056ac)
   
   ### Example codes for reproduce this issue (such as a github link).
   


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


Re: [I] fuzzy query with encrypt isn't support like operate with escape [shardingsphere]

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

   Hi @ShcRes, can you provide the init table sql? I want to reproduce this exception.


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


Re: [I] fuzzy query with encrypt isn't support like operate with escape [shardingsphere]

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

   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


Re: [I] fuzzy query with encrypt isn't support like operate with escape [shardingsphere]

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

   Hi @ShcRes, thank you for your feedback. Do you want to submit a pr to fix 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


Re: [I] fuzzy query with encrypt isn't support like operate with escape [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #32261: fuzzy query  with encrypt isn't support like operate with escape
URL: https://github.com/apache/shardingsphere/issues/32261


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