-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Accept additional function argument literals for correct native query with pageable rewrite #2884
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
Comments
The problem lies in Unfortunately, the A flaw in all this is the fact that the |
A native SQL function with ';' as an argument, e.g. listagg(a.b, ';'), will fail to find anything after it (like an alias). By adding ';' to the list of approved function tokens, queries with functional aliases will work properly. Resolves #2884.
I'm migrating a project from Spring Boot 2.7.9 to 3.0.4. I have the following pageable, native query with a list_agg function:
Calling this function results under Spring Boot 3.0.x in a DataIntegrityViolationException because the second parameter could not be bound. This ist the generated SQL:
As you can see the "fetch first ? rows only" section is now part of the delimter literal of the list_agg function.
Under Spring Boot 2.7.9 everything works as expected.
Attached projects to reproduce this anomality.
Hibernate6NativeQueryIssue.zip
PageableNativeQuerySpringBoot2.zip
The text was updated successfully, but these errors were encountered: