[CONJ-947] Microsecond precision lost when timestamp is encoded Created: 2022-03-26  Updated: 2022-03-28  Resolved: 2022-03-28

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 3.0.4
Fix Version/s: 3.0.5

Type: Bug Priority: Major
Reporter: Romain Moreau Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

In TimestampCodec, encodeText uses a SimpleDateFormat with the format yyyy-MM-dd HH:mm:ss.SSS which removes microseconds while they are supported by the MariaDB server.



 Comments   
Comment by Diego Dupin [ 2022-03-28 ]

Right, thanks for reporting this.

only millisecond was saved:
Example Timestamp.valueOf("2010-01-12 01:55:13.123456") was saved like Timestamp.valueOf("2010-01-12 01:55:13.123")
problem concerns either Text or binary encoding.

corrected with commit https://github.com/mariadb-corporation/mariadb-connector-j/commit/0231bb7c006b84de5811a460eb8890ffdbd9ddf5 and will be part of 3.0.5 version

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