Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated MySQL 8.0.26 connector breaks historically working code #350

Open
mumitr0ll opened this issue Sep 3, 2021 · 2 comments
Open

Updated MySQL 8.0.26 connector breaks historically working code #350

mumitr0ll opened this issue Sep 3, 2021 · 2 comments

Comments

@mumitr0ll
Copy link

Spring Boot starter from summer 2021 uses the connector: mysql-connector-java-8.0.26.jar. This DOES NOT work with historical code. However, overriding the Spring Boot and using the previous version 8.0.16 does work with sql2o.

There is something about the latest that is not working, and it is unclear if the problem is with Oracle's connector or with the sql2o codebase. But with 8.0.26 there are type-mapping inconsistencies that cause Sql2oExceptions. My SO case is here:
https://stackoverflow.com/questions/69038452/does-sql2o-work-with-the-latest-mysql-versions

@davidlzs
Copy link

MySQL JDBC driver (Connector/J) 8.0.23 contains an Important Change:

Also, with the implementation of the new mechanism, a getObject(columnIndex) call on a DATETIME column returns a LocalDateTime object now

We ran into this error by upgrading the MySQL JDBC driver to 8.0.22+
Caused by: org.sql2o.converters.ConverterException: Cannot convert type class java.time.LocalDateTime to java.util.Date at org.sql2o.converters.AbstractDateConverter.convert(AbstractDateConverter.java:35) at org.sql2o.converters.AbstractDateConverter.convert(AbstractDateConverter.java:9) at org.sql2o.data.Row.getObject(Row.java:56) ... 34 more

@davidlzs
Copy link

I created the PR #359, which is addressed the Important Change in MySQL JDBC driver (Connector/J) 8.0.23 contains an Important Change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants