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

Fix getTotalCount() with Hibernate for sorting parameters #756

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

darxriggs
Copy link
Contributor

@darxriggs darxriggs commented Oct 1, 2023

Don't have sorting in the generated query. Otherwise, depending on the database and its strictness configuration, the query might fail.

Fixes #297.

About the distinct(true) I am not sure. At least for simple queries it would not be necessary. I have kept it because maybe I am missing corner cases.

This change will only be covered by tests once grails/grails-data-mapping#1758 is merged and a new version of grails-datastore-gorm-tck including it used.

Don't have sorting in the generated query. Otherwise, depending on the
database and its strictness configuration, the query might fail.

The `PagedResultSpec` in `grails-datastore-gorm-tck` covers this.
@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
Copy link
Contributor

Please send a PR to 7.3.x branch as well.

@puneetbehl puneetbehl merged commit 7af76df into grails:8.0.x Oct 5, 2023
2 checks passed
@darxriggs darxriggs deleted the getTotalCount-and-sorting branch October 5, 2023 18:31
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.

V7.0.5 with Postgres: list(max:...) causes exception on totalCount
3 participants