Totuying opened a new issue #13233:
URL: https://github.com/apache/shardingsphere/issues/13233


   ## 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?
   4.1.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   routeValue = 'DS632624670761930754'
   
   
   ### Actual behavior
   routeValue = '2021-10-23 01:59:44.034'
   
   
   ### Reason analyze (If you can)
   Version 3.1.0 is no problem ,But upgrading to 4.1.1 fragmented routing has 
problems
   I tried to experiment with several schemes,
   Finally, tracking and debugging found,
   If I only use the case when statement to update, there is no problem, if the 
non-case when statement is added, the fragmentation strategy will drift。
   
   It feels like gmt_modify =? Caused by re-marking, 
   ParameterMarkerExpressionSegment(startIndex=339, stopIndex=339, 
parameterMarkerIndex=1)
   Theoretically, parameterMarkerIndex should be 0
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   #分片策略
   shardingRule:
     tables:
       t_asset_detail:
         actualDataNodes: ds$->{0..13}.t_asset_detail
         databaseStrategy:
           inline:
             shardingColumn: asset_item_no
             algorithmExpression: ds$->{Math.abs(asset_item_no.hashCode() % 14)}
     bindingTables:
       - t_asset_detail
   
   
   **Error example**
   UPDATE t_asset_detail
    SET holder =
           CASE WHEN 
               asset_item_no = ? AND ? >= gmt_holder THEN ? ELSE holder END ,
       gmt_modify = ? 
   WHERE asset_item_no = ?
   AND is_deleted = 0
   
   Parameters: DS632624670761930754(String), 2021-10-23 
01:50:21.416(Timestamp), 4(Integer), 2021-10-23 01:50:21.416(Timestamp), 
DS632624670761930754(String)
   **Normal example**
   UPDATE t_asset_detail
    SET holder =
           CASE WHEN 
               asset_item_no = ? AND ? >= gmt_holder THEN ? ELSE holder END 
   WHERE asset_item_no = ?
   AND is_deleted = 0
   
   Parameters: DS632624670761930754(String), 2021-10-23 
01:50:21.416(Timestamp), 4(Integer), DS632624670761930754(String)
   
   ### 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