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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   
https://github.com/apache/shardingsphere/commit/0108aff2dd53a1fc2078fbf388e2cf2deee19445
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   The t_account_bak table contains "account_id", "password", "amount" columns.
   
   Following is the configuration.
   
   ```yaml
   dataSources:
     db:
       dataSourceClassName: org.apache.shardingsphere.test.mock.MockedDataSource
   
   rules:
   - !SHARDING
     tables:
       t_account:
         actualDataNodes: db.t_account_${0..1}
         tableStrategy: 
           standard:
             shardingColumn: account_id
             shardingAlgorithmName: t_account_inline
         keyGenerateStrategy:
           column: account_id
           keyGeneratorName: rewrite_keygen_fixture
       t_account_bak:
         actualDataNodes: db.t_account_bak_${0..1}
         tableStrategy: 
           standard:
             shardingColumn: account_id
             shardingAlgorithmName: t_account_bak_inline
         keyGenerateStrategy:
           column: account_id
           keyGeneratorName: rewrite_keygen_fixture
       t_account_detail:
         actualDataNodes: db.t_account_detail_${0..1}
         tableStrategy: 
           standard:
             shardingColumn: account_id
             shardingAlgorithmName: t_account_detail_inline
     bindingTables:
       - t_account, t_account_detail
     
     shardingAlgorithms:
       t_account_inline:
         type: INLINE
         props:
           algorithm-expression: t_account_${account_id % 2}
       t_account_bak_inline:
         type: INLINE
         props:
           algorithm-expression: t_account_bak_${account_id % 2}
       t_account_detail_inline:
         type: INLINE
         props:
           algorithm-expression: t_account_detail_${account_id % 2}
     
     keyGenerators:
       rewrite_keygen_fixture:
         type: REWRITE.FIXTURE
   
   - !ENCRYPT
     tables:
       t_account:
         columns:
           password:
             cipherColumn: cipher_password
             assistedQueryColumn: assisted_query_password
             encryptorName: rewrite_normal_fixture
             assistedQueryEncryptorName: rewrite_assisted_query_fixture
           amount:
             cipherColumn: cipher_amount
             encryptorName: rewrite_normal_fixture
       t_account_bak:
         columns:
           password:
             cipherColumn: cipher_password
             assistedQueryColumn: assisted_query_password
             plainColumn: plain_password
             encryptorName: rewrite_normal_fixture
             assistedQueryEncryptorName: rewrite_assisted_query_fixture
           amount:
             cipherColumn: cipher_amount
             plainColumn: plain_amount
             encryptorName: rewrite_normal_fixture
       t_account_detail:
         columns:
           password:
             cipherColumn: cipher_password
             assistedQueryColumn: assisted_query_password
             plainColumn: plain_password
             encryptorName: rewrite_normal_fixture
             assistedQueryEncryptorName: rewrite_assisted_query_fixture
           amount:
             cipherColumn: cipher_amount
             plainColumn: plain_amount
             encryptorName: rewrite_normal_fixture
     encryptors:
       rewrite_normal_fixture:
         type: REWRITE.NORMAL.FIXTURE
       rewrite_assisted_query_fixture:
         type: REWRITE.ASSISTED_QUERY.FIXTURE
   ```
   
   When I execute this sql.
   
   ```sql
   INSERT INTO t_account_bak VALUES (?, ?), ('bbb', 2000), (?, ?), ('ddd', 
4000)" parameters="aaa, 1000, ccc, 3000
   ```
   
   I hope it can be executed successfully, and the rewrite sql should be 
`INSERT INTO t_account_bak_1(cipher_password, assisted_query_password, 
plain_password, cipher_amount, plain_amount, account_id) VALUES (?, ?, ?, ?, ?, 
?), ('encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 1), (?, 
?, ?, ?, ?, ?), ('encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 
4000, 1)`, the rewrite parameters may be `encrypt_aaa, assisted_query_aaa, aaa, 
encrypt_1000, 1000, 1, encrypt_ccc, assisted_query_ccc, ccc, encrypt_3000, 
3000, 1`.
   
   ### Actual behavior
   
   The order of rewrite parameters are wrong.
   
   ```sql
   encrypt_aaa, assisted_query_aaa, aaa, encrypt_1000, 1, 1000, encrypt_ccc, 
assisted_query_ccc, ccc, encrypt_3000, 1, 3000
   ```
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   ### 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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to