springboot 2.2.6 release mybatis-spring-boot-starter: 2.1.2 mysql 5.7.24 mapper.xml:
1. select id, intTypeField, dataTimeTypeField from mysqltable where id=123 for update 2. select id, dataTimeTypeField, intTypeField from mysqltable where id=123 for update the first sql statement will throws java.sql.SQLDataException: Unsupported conversion from LONG to java.sql.Timestamp, but the second sql statement (only exchange location of the last two fields) will be ok. these two sql statements executed well under springboot 2.1.1 release.

Comment From: zrlw

i tested these two sql on springboot 2.1.3, 2.1,4 and got same results , but since v2.1.5 running the first sql began to throw java.sql.SQLDataException: Unsupported conversion from LONG to java.sql.Timestamp.

Comment From: wilkinsona

@zrlw Thanks for the report. If you're using MyBatis, Spring Boot has very little involvement in the type conversion performed at the JDBC level so it's not clear to me why changing the Spring Boot version would change your application's behaviour. We upgraded to 8.0.16 of MySQL's JDBC driver in Spring Boot 2.1.5. I suspect that this is the most likely cause. Can you please try your application with different versions of the MySQL JDBC driver. If that doesn't help you to resolve the problem and you would like us to spend some more time investigating, please take the time to provide a minimal sample that reproduces the problem.

Comment From: zrlw

i tested first sql on: 1. springboot v2.2.6 + mysql-connector-java v8.0.13 : OK 2. springboot v2.2.6 + mysql-connector-java v8.0.14 : OK 3. springboot v2.2.6 + mysql-connector-java v8.0.15 : OK 4. springboot v2.2.6 + mysql-connector-java v8.0.16 : SQLDataException should i submit the issue to mysql myself? or wait for your negotiation with mysql?

Comment From: wilkinsona

Thanks for trying the different version of the MySQL JDBC driver. I would recommend checking the release notes to see if the change in behaviour is mentioned. It's also worth checking more up-to-date versions as the problem may have been fixed. At the time of writing, 8.0.20 is the latest. If this does not help, you should report the issue to MySQL yourself, providing enough information for them to reproduce the problem.

Comment From: zrlw

i tested on mysql jdbc latest driver 8.0.20, unfortunately it has the same issue.

Comment From: zrlw

fixed it by adding default constructor in the Mybatis DO class which only had a parameter constructor for the issue table.