Fix incorrect rowCount value when using groupBy with fetchPage #1852
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
Fixes incorrect
rowCount
value when using agroupBy
statement with the pagination plugin'sfetchPage()
method.Motivation
There was already a previous PR, linked above, but its author didn't seem interested in adding the required tests.
Proposed solution
This is a simpler solution than the one in the previous PR, since it doesn't try to make a different type of query to get the total count, which would require additional processing. This just changes the column names that are passed to the existing
countDistinct
query.Closes #1827, fixes #1489.