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 2019/11/25 02:04:26 UTC

[GitHub] [incubator-shardingsphere] junwangit opened a new issue #3584: Mybatis batch update, encrypt rule is invalid

junwangit opened a new issue #3584: Mybatis batch update, encrypt rule is invalid
URL: https://github.com/apache/incubator-shardingsphere/issues/3584
 
 
   ## 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/incubator-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 **more than 7 days** 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?
   
   4.0.3-RC
   
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   
   Sharding-JDBC
   
   ### Expected behavior
   
   Mybatis batch update, able to use encrypt rules
   
   ### Actual behavior
   
   Except for the first article using encrypt rules, the others are useless.
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   `<update id="batchUpdate" parameterType="java.util.List">
           <foreach collection="list" item="bean" index="index" open="" close="" separator=";">
               UPDATE luck_partner
               set
               master_phone=#{bean.masterPhone},
               master_id_card=#{bean.masterIdCard},
               owner_phone=#{bean.ownerPhone},
               owner_id_card=#{bean.ownerIdCard}
               <where>
                   id = #{bean.id}
               </where>
           </foreach>
       </update>
   `
   
   result:
   `
   [INFO][2019-11-25 09:43:07,246][ShardingSphere-SQL]Rule Type: encrypt
   [INFO][2019-11-25 09:43:07,246][ShardingSphere-SQL]SQL: UPDATE luck_partner
               set
               master_phone_chiper = ?, master_phone = ?,
               master_id_card_chiper = ?, master_id_card = ?,
               owner_phone_chiper = ?, owner_phone = ?,
               owner_id_card_chiper = ?, owner_id_card = ?
                WHERE id = ? 
            ; 
               UPDATE luck_partner
               set
               master_phone=?,
               master_id_card=?,
               owner_phone=?,
               owner_id_card=?
                WHERE id = ? 
            ; 
               UPDATE luck_partner
               set
               master_phone=?,
               master_id_card=?,
               owner_phone=?,
               owner_id_card=?
                WHERE id = ? 
            ; 
   `
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services