Skip to content
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

Add getTotalCount() tests for sorting parameters #1758

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

darxriggs
Copy link
Contributor

This is to check that a getTotalCount() implementation should not have sorting in the generated query.
Otherwise, depending on the database and its strictness configuration, the query might fail.

In the gorm-hibernate5 project one test would fail a follows:

org.h2.jdbc.JdbcSQLSyntaxErrorException: Order by expression "UPPER(PERSON0_.FIRST_NAME)" must be in the result list in this case; SQL statement:
select distinct count(person0_.id) as col_0_0_ from person person0_ order by upper(person0_.first_name) desc [90068-200]

I will also provide a fix for it.

This is for consistency with the test for the criteria.
This is to check that a getTotalCount() implementation should not
have sorting in the generated query. Otherwise, depending on the
database and its strictness configuration, the query might fail.
@CLAassistant
Copy link

CLAassistant commented Oct 1, 2023

CLA assistant check
All committers have signed the CLA.

@darxriggs
Copy link
Contributor Author

@puneetbehl When merging this, please also back port it to 7.3.x.

@puneetbehl puneetbehl merged commit 93a3048 into grails:8.0.x Oct 5, 2023
3 checks passed
@puneetbehl
Copy link
Contributor

Can you please cherry-pick and send a PR to 7.3.x branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants