Bug #102302 | getObject returns LocalDateTime instead of Timestamp for DATETIME columns | ||
---|---|---|---|
Submitted: | 20 Jan 2021 0:44 | Modified: | 20 Jan 2021 19:29 |
Reporter: | Andre Burgoyne | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | 8.0.23 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[20 Jan 2021 0:44]
Andre Burgoyne
[20 Jan 2021 8:01]
MySQL Verification Team
Hello Andre, Thank you for the report and test case. regards, Umesh
[20 Jan 2021 8:01]
MySQL Verification Team
-- C/J 8.0.22 ant -f C:\\Work\\MySQLJava\\TimeBug -Dnb.internal.action.name=run run init: deps-jar: Created dir: C:\Work\MySQLJava\TimeBug\build Updating property file: C:\Work\MySQLJava\TimeBug\build\built-jar.properties Created dir: C:\Work\MySQLJava\TimeBug\build\classes Created dir: C:\Work\MySQLJava\TimeBug\build\empty Created dir: C:\Work\MySQLJava\TimeBug\build\generated-sources\ap-source-output Compiling 1 source file to C:\Work\MySQLJava\TimeBug\build\classes compile: run: MySQL Connector/J version mysql-connector-java-8.0.22 (Revision: d64b664fa93e81296a377de031b8123a67e6def2) DATE column 1 is expected type java.sql.Date DATETIME column 2 is expected type java.sql.Timestamp TIMESTAMP column 3 is expected type java.sql.Timestamp BUILD SUCCESSFUL (total time: 3 seconds) -- C/J 8.0.23 ant -f C:\\Work\\MySQLJava\\TimeBug -Dnb.internal.action.name=run run init: Deleting: C:\Work\MySQLJava\TimeBug\build\built-jar.properties deps-jar: Updating property file: C:\Work\MySQLJava\TimeBug\build\built-jar.properties compile: run: MySQL Connector/J version mysql-connector-java-8.0.23 (Revision: 18bbd5e68195d0da083cbd5bd0d05d76320df7cd) DATE column 1 is expected type java.sql.Date ERROR: DATETIME column 2 is NOT expected type java.sql.Timestamp, it is java.time.LocalDateTime TIMESTAMP column 3 is expected type java.sql.Timestamp BUILD SUCCESSFUL (total time: 2 seconds)
[20 Jan 2021 8:11]
Alexander Soklakov
Hi Andre, It's not a bug, but the intended change in c/J 8.0.23. Please check: https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-date-time.html https://insidemysql.com/support-for-date-time-types-in-connector-j-8-0/
[20 Jan 2021 17:09]
Andre Burgoyne
But in that case the bug is that getColumnClassName is returning the wrong class name. There is a mismatch between the class that getObject returns and what getColumnClassName returns.
[20 Jan 2021 18:47]
Alexander Soklakov
Right, we missed that. Could you create a bug report for this issue?
[20 Jan 2021 19:13]
Andre Burgoyne
Will do.
[20 Jan 2021 19:29]
Andre Burgoyne
https://bugs.mysql.com/bug.php?id=102321
[27 Jan 2022 13:30]
Alexander Soklakov
Bug#106300 is marked as a duplicate of this one.
[21 Jul 2023 5:05]
MySQL Verification Team
Bug #111832 marked as duplicate of this one