spring-data-r2dbc
spring-data-r2dbc copied to clipboard
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
trafficstars
- java 17
- spring-boot-starter-parent: 2.6.4; spring-boot-starter-webflux; r2dbc-mysql
- person record:
@Table("person")
record Person(@Id Integer id, String name, String surname) {}
- person repository:
public interface PersonRepo extends ReactiveCrudRepository<Person, Integer>{}
- person controller:
@GetMapping("/{id}")
private Mono<Person> findById(@PathVariable Integer id) {
return personRepo.findById(id);
}
- error:
Caused by: com.github.jasync.sql.db.mysql.exceptions.MySQLException: Error 1064 - #42000 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
-
using 2 different drivers, same error:
-
com.github.jasync-sql:jasync-r2dbc-mysql:2.0.6
2022-03-24 07:21:42.623 ERROR 20852 --- [-netty-thread-1] c.g.jasync.sql.db.mysql.MySQLConnection : <mysql-connection-1> Received an error message -> ErrorMessage(errorCode=1064, sqlState=#42000, errorMessage=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1)
2022-03-24 07:21:42.692 ERROR 20852 --- [-netty-thread-2] c.g.jasync.sql.db.mysql.MySQLConnection : <mysql-connection-2> Received an error message -> ErrorMessage(errorCode=1064, sqlState=#42000, errorMessage=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1)
- dev.miku:r2dbc-mysql:0.8.2.RELEASE
Caused by: io.r2dbc.spi.R2dbcBadGrammarException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
at dev.miku.r2dbc.mysql.ExceptionFactory.createException(ExceptionFactory.java:81) ~[r2dbc-mysql-0.8.2.RELEASE.jar:0.8.2.RELEASE]
- I try with R2dbcRepository interface, same error
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal sample that reproduces the problem.
is there any spring property for r3dbc that will log SQL statements, like spring.jpa.show-sql?
You can enable debug logging if you set the logger org.springframework.r2dbc.core to DEBUG.
logging.level.org.springframework.r2dbc.core=DEBUGno sql in log