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/11/12 13:32:02 UTC

[GitHub] [shardingsphere] strongduanmu opened a new issue, #22120: Wrong column return when I config likeQueryColumn with encrypt feature

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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   [c214e82](https://github.com/apache/shardingsphere/commit/c214e82f0f8dd89a0b85aa81b273a511e950304e)
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   Return right columns when I execute `select * from t_encrypt;`
   
   ### Actual behavior
   
   user_like is the likeQueryColumn.
   
   ```sql
   mysql> select * from t_encrypt;
   +---------+-----------+----------------------------------+---------+
   | user_id | user_like | order_id                         | content |
   +---------+-----------+----------------------------------+---------+
   | 11      | 00        | 6512bd43d9caa6e02c990b0a82652dca | test11  |
   | 22      | 11        | b6d767d2f8ed5d21a44b0e5886680cb9 | test22  |
   | 33      | 44        | a7bac2239fcdcb3a067903d8077c4a07 | test33  |
   +---------+-----------+----------------------------------+---------+
   3 rows in set (0.00 sec)
   ```
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   Config encrypt like followings:
   
   ```yaml
   databaseName: encrypt_db
   
   dataSources:
     ds_0:
       url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !ENCRYPT
     encryptors:
       aes_encryptor:
         type: AES
         props:
           aes-key-value: 123456abc
       md5_encryptor:
         type: MD5
       char_digest_like_encryptor:
         type: CHAR_DIGEST_LIKE
     tables:
       t_encrypt:
         columns:
           user_id:
             plainColumn: user_plain
             cipherColumn: user_cipher
             likeQueryColumn: user_like 
             encryptorName: aes_encryptor
             likeQueryEncryptorName: char_digest_like_encryptor
           order_id:
             cipherColumn: order_cipher
             encryptorName: md5_encryptor
   ```
   
   And then execute create table, insert and select statement:
   
   ```sql
   CREATE TABLE `t_encrypt` (
     `user_id` varchar(100) DEFAULT NULL,
     `order_id` varchar(100) DEFAULT NULL,
     `content` varchar(100) DEFAULT NULL
   ) ENGINE=InnoDB;
   
   INSERT INTO t_encrypt(user_id, order_id, content) VALUES('中文123', '44', 'test33');
   
   select * from t_encrypt;
   ```
   
   ### 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


[GitHub] [shardingsphere] yx9o closed issue #22120: Wrong column return when I config likeQueryColumn with encrypt feature

Posted by GitBox <gi...@apache.org>.
yx9o closed issue #22120: Wrong column return when I config likeQueryColumn with encrypt feature
URL: https://github.com/apache/shardingsphere/issues/22120


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