right syntax to use near ''
sysmat opened this issue · 1 comments
sysmat commented
-
java: 17
-
spring-boot: 2.6.4
-
r2dbc-mysql-0.8.2.RELEASE
-
record Person:
record Person(@Id Integer id, String name, String surname) {
boolean hasId() {
return id != null;
}
}
- Person repository:
public interface PersonRepo extends ReactiveCrudRepository<Person, Integer>{
@Query("select id, name, surname from person p where p.surname = :surname")
Flux<Person> findBySurname(String surname);
}
- person controller:
@GetMapping("/{id}")
private Mono<Person> getPersonById(@PathVariable Integer id) {
return personRepo.findById(id);
}
- error:
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
sysmat commented
It is not driver error, I tried jasync-r2dbc-mysql
and the same error, so it must be spring bug in ReactiveCrudRepository