-
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
Count query removes distinct
phrase if from part of JPA query contains newline character
#2341
Labels
Milestone
Comments
This might also be the case in #2177 |
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Oct 19, 2021
schauder
added
in: query-parser
Everything related to parsing JPQL or SQL
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Oct 19, 2021
DiegoKrupitza
added a commit
to DiegoKrupitza/spring-data-jpa
that referenced
this issue
Dec 17, 2021
The `COUNT_MATCH` did not consider line breaks after the `from` clause or the `where` clause. This lead to a no match scenario in the construction of the count query. With the fix we now consider line breaks/whitespaces after the `from` and `where` clause. Closes spring-projects#2341 Related tickets spring-projects#2177
3 tasks
Please have a look #2177 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
It seems that there is newline character after the entity alias name in
FROM
part of the query before theJOIN
the distinct is removed from the count.Incorrect behavior:
returns
Correct behaviour:
returns
From testing if the
FROM
andJOIN
are in the same line, andWHERE
is new line then this incorrect behavior also occurs.For now I have solved it with
countProjection = "distinct entity1"
.The text was updated successfully, but these errors were encountered: