SirMin opened a new issue #14175:
URL: https://github.com/apache/shardingsphere/issues/14175


   ## 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?
   5.0.0
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
    ShardingSphere-JDBC 
   ### Expected behavior
   exeucte success
   ### Actual behavior
   Exception in thread "main" java.lang.ClassCastException: 
java.time.LocalDateTime cannot be cast to java.sql.Timestamp
   ### Reason analyze (If you can)
   
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement#execute()
 use inner class
   
![image](https://user-images.githubusercontent.com/16568907/146749895-b9128af4-c0e9-472c-a217-b079039c1459.png)
   
![image](https://user-images.githubusercontent.com/16568907/146749935-f5098ef6-c75f-4e8c-a836-b53a08963ff7.png)
   but 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement#executeQuery0
 use PreparedStatementExecuteQueryCallback
   
![image](https://user-images.githubusercontent.com/16568907/146750062-7837d901-dedd-4b19-8f35-4eceb4bfaa77.png)
   if need merge PreparedStatementExecuteQueryCallback handle type use db type
   inner class use getObject, in mysql driver 8.x DateTime return LocalDateTime
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   1. Preparation phase
   * mysql connector driver 8.x
   * sql has group by
   * table sharding or db sharding
   2. Execute phase
   * call 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement#execute()
   * call 
org.apache.shardingsphere.driver.jdbc.core.resultset.ShardingSphereResultSet#getTimestamp(java.lang.String)
   ### Example codes for reproduce this issue (such as a github link).
   https://github.com/SirMin/shardingsphere5.x-demo


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