Bug #82707 Wrong milli second value returned from Timestamp column
Submitted: 24 Aug 2016 10:34 Modified: 9 Mar 2017 0:37
Reporter: David Edwards Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:6.0.3 OS:Windows (10 (1607))
Assigned to: CPU Architecture:Any

[24 Aug 2016 10:34] David Edwards
Description:
Within MySql Workbench
select Started from Myschema.matches;
2016-08-24 07:47:46.057000

JDBC select Started from Myschema.matches;
getString=2016-08-24 07:47:46.570000
getTimestamp=2016-08-24 07:47:46.0570000
  
i.e. getString is getting the mS wrong

How to repeat:
Create a column called Started with a TIMESTAMP(6) data type
Populate with value 2016-08-24 07:47:46.057000
Use Connector/J 6.0.3 with driver class com.mysql.cj.jdbc.Driver
Read value with JDBC.getString and observe incorrect mS value 2016-08-24 07:47:46.570000
[24 Aug 2016 13:14] Chiranjeevi Battula
Hello David Edwards,

Thank you for the bug report.
Verified this behavior on MySQL Connector / J 6.0.3.

Thanks,
Chiranjeevi.
[24 Aug 2016 13:15] Chiranjeevi Battula
output:5.1.39

2016-08-24 07:47:46.057
2016-08-24 16:53:10.056
2016-08-24 16:53:20.0
2016-08-24 16:53:28.00045
2016-08-24 16:53:29.0
2016-08-24 16:53:30.0023

output:6.0.3

2016-08-24 07:47:46.57000000
2016-08-24 16:53:10.56000000
2016-08-24 16:53:20
2016-08-24 16:53:28.450000
2016-08-24 16:53:29
2016-08-24 16:53:30.2300000
[9 Mar 2017 0:37] Daniel So
Posted by developer:
 
Added the following entry to the Connector/J 6.0.6 changelog:

"The getString()method returned wrong millisecond values for the TIMESTAMP data type."