Bug #104170 Contribution: ClientPreparedStmt: Leave Calendar untouched
Submitted: 30 Jun 2021 14:25 Modified: 20 Sep 2021 18:46
Reporter: OCA Admin (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[30 Jun 2021 14:25] OCA Admin
Description:
This bug tracks a contribution by Björn Michael (Github user: bjmi) as described in http://github.com/mysql/mysql-connector-j/pull/62

How to repeat:
See description

Suggested fix:
See contribution code attached
[30 Jun 2021 14:25] OCA Admin
Contribution submitted via Github - ClientPreparedStmt: Leave Calendar untouched 
(*) Contribution by Björn Michael (Github bjmi, mysql-connector-j/pull/62#issuecomment-871234893): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_650563631.txt (text/plain), 2.15 KiB.

[30 Jun 2021 14:35] MySQL Verification Team
Hello Björn,

Thank you for the report and contribution.

regards,
Umesh
[20 Sep 2021 18:46] Daniel So
Posted by developer:
 
Added the following entry to the Connector/J 8.0.27 changelog: 

"After a Calendar was passed as a parameter to a ClientPreparedStatement set method, the SimpleDateFormat object used to render the parameter value actually modified the Calendar, so that using the same Calendar object with several set methods resulted sometimes in the wrong date or time being set. With this fix, a clone of the Calendar is passed to the SimpleDateFormat object when it is created, to avoid changing the original Calendar. 

Thanks to Björn Michael for his contribution to the fix."