-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Broken count query for native queries with table alias #2773
Comments
The query rewrite doesn't distinguish between native an JPQL queries. In JPQL, this is a valid scheme to count on |
Thanks for implementing a fix so quickly after I created the issue! As the issue is assigned to the milestone 2.7.8, this may be a stupid question, but will the fix be backported? I'm asking because the issue is closed but there is no respective commit on the branch 2.7.x. |
Thanks for reaching out. The missing backport was an oversight on our end. The backport is now in the 2.7.x branch and you should be able to verify the fix in the artifact that is being currently built by our CI. |
The following repository currently does not work with MySQL:
The repository worked fine with Spring Data JPA 2.6.3, has been broken since 2.6.4, and is still broken in 2.7.7.
The log on failure is
The problem is the count query that should be
select count(*) FROM table_name some_alias
with*
instead of the alias as parameter toCOUNT
.The regression seems to have been introduced with #2389 as the PR contains a test case for the erroneous behavior.
The text was updated successfully, but these errors were encountered: