[CONJ-107] setTimestamp truncates milliseconds Created: 2014-08-29  Updated: 2014-10-21  Resolved: 2014-10-21

Status: Closed
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: 1.1.7
Fix Version/s: 1.1.8

Type: Bug Priority: Minor
Reporter: Marcel Schneider Assignee: Massimo Siani (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 7, 64bit



 Description   

I submitted a description of the bug to stackoverflow. I hope it is ok to just provide the link here (otherwise I can copy&paste it):

http://stackoverflow.com/questions/25445807/mariadb-jdbc-settimestamp-truncates-milliseconds



 Comments   
Comment by Massimo Siani (Inactive) [ 2014-09-15 ]

Fix available at
https://code.launchpad.net/~massimo-siani/mariadb-java-client/CONJ-107

Comment by Andy Shulman [ 2014-09-17 ]

Massimo, your fix has a mistake. You set useFractionalSeconds to true if the property is missing or false. The only way to turn useFractionalSeconds off now is to pass it a value OTHER THAN true or false. I think the fix should be as follows:

String fractionalSeconds = info.getProperty("useFractionalSeconds", "true");
if ("true".equalsIgnoreCase(fractionalSeconds)) {
    info.setProperty("useFractionalSeconds", "true");
}

That way it defaults to true, but users can still turn it off by passing values other than true to the driver.

Comment by Massimo Siani (Inactive) [ 2014-09-18 ]

Thanks, fixed.

Generated at Thu Feb 08 03:13:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.