You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the MySQL connector reads timestamp/datetime values as TIMESTAMP(3) and only supports writing TIMESTAMP(3) even though MySQL supports values upto precision 6.
Due to MySQL using the legacy default type-mappings we cannot round-trip timestamps which lie within a "gap" in some timezone.
While making this change, proper tests should be added to assert both datetime and timestamp values round-trip properly (where possible).
For properly supporting reading timestamp(p) where p matches the precision as defined in MySQL we need to upgrade the JDBC driver to include mysql/mysql-connector-j@696c6c4 (first available in 8.0.16).
Any driver older than that doesn't return the precision for temporal data tyes. And any server version older than 5.6.4 doesn't support fractional seconds in any timestamp type at all (everything is limited to seconds precision).
To finish this work I'm working on upgrading the JDBC driver first.
NOTE: Trying to read as a String using getObject also doesn't help because MySQL doesn't return fixed width strings depending on precision of column. i.e. a value with fractional seconds as 123000 in a datetime(6) column is returned as a string ending in .123 instead of .123000. So we can't use this to infer the precision of the column when reading the values.
timestamp/datetime
values asTIMESTAMP(3)
and only supports writingTIMESTAMP(3)
even though MySQL supports values upto precision 6.While making this change, proper tests should be added to assert both
datetime
andtimestamp
values round-trip properly (where possible).rel #5449
The text was updated successfully, but these errors were encountered: