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 2020/05/08 07:31:27 UTC

[GitHub] [shardingsphere] tristaZero opened a new issue #5465: Wrong rewritten SQL for `ON DUPLICATE KEY UPDATE` when configuring encrypt rule.

tristaZero opened a new issue #5465:
URL: https://github.com/apache/shardingsphere/issues/5465


   SQL Case: 
   ```
   INSERT INTO t_account_bak(account_id, certificate_number, password, amount, status) VALUES (?, ?, ?, ?, ?), (2, '222X', 'bbb', 2000, 'OK'), (?, ?, ?, ?, ?), (4, '444X', 'ddd', 4000, 'OK') ON DUPLICATE KEY UPDATE password = ?
   ```
   
   The expected rewritten SQL is
   ```
   INSERT INTO t_account_bak(account_id, cipher_certificate_number, assisted_query_certificate_number, plain_certificate_number, cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?), (2, 'encrypt_222X', 'assisted_query_222X', '222X', 'encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 'OK'), (?, ?, ?, ?, ?, ?, ?, ?, ?, ?), (4, 'encrypt_444X', 'assisted_query_444X', '444X', 'encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 4000, 'OK') ON DUPLICATE KEY UPDATE cipher_password = ?, assisted_query_password = ?, plain_password = ?" INSERT INTO t_account_bak(account_id, certificate_number, password, amount, status) VALUES (?, ?, ?, ?, ?), (2, '222X', 'bbb', 2000, 'OK'), (?, ?, ?, ?, ?), (4, '444X', 'ddd', 4000, 'OK') ON DUPLICATE KEY UPDATE password = ?
   ```
   
   The related parameter and function:
   
   The following items in `EncryptInsertOnDuplicateKeyUpdateValueParameterRewriter`
   ```
   private boolean queryWithCipherColumn;
   public void rewrite(final ParameterBuilder parameterBuilder, final InsertStatementContext insertStatementContext, final List<Object> parameters)
   ```
   
   


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

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



[GitHub] [shardingsphere] neil4dong commented on issue #5465: Wrong rewritten SQL for `ON DUPLICATE KEY UPDATE` when configuring encrypt rule.

Posted by GitBox <gi...@apache.org>.
neil4dong commented on issue #5465:
URL: https://github.com/apache/shardingsphere/issues/5465#issuecomment-625688226


   Ok. just assign to me .


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

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



[GitHub] [shardingsphere] tristaZero commented on issue #5465: Wrong rewritten SQL for `ON DUPLICATE KEY UPDATE` when configuring encrypt rule.

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #5465:
URL: https://github.com/apache/shardingsphere/issues/5465#issuecomment-629212297


   Fixed already!


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

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



[GitHub] [shardingsphere] tristaZero commented on issue #5465: Wrong rewritten SQL for `ON DUPLICATE KEY UPDATE` when configuring encrypt rule.

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #5465:
URL: https://github.com/apache/shardingsphere/issues/5465#issuecomment-625681839


   @neil4dong Hi, We need you here. 😀 


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

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



[GitHub] [shardingsphere] tristaZero closed issue #5465: Wrong rewritten SQL for `ON DUPLICATE KEY UPDATE` when configuring encrypt rule.

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #5465:
URL: https://github.com/apache/shardingsphere/issues/5465


   


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

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