Fix (unreleased) regression on report pager #12149
Merged
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.
Overview
5.2 rc exhibits a regression whereby reports are missing their pages - this fixes.
Before
After
Technical Details
We recently added a patch to disable full group by before some queries that were not
compliant with that standard. That patch broke the report pager because later code relied on the
last issued query ALWAYS being the one that determined how many rows are retrived by the main query,
however, we were doing a query to check sql mode after the main query.
I could make a case for storing sql mode data somewhere sensible at the start of the session.
However, I think this fix is the right fix for the bug as it calculates the rows retrieved
/ retrievable immediately after the retrieval query, rather than 'at some later date when
we hope no other queries have run'. If is in the same function as the enableFullGroupBy so
only reports that ALSO run that will hit the line (ie. not reports that override buildRows)
Comments
@seamuslee001 @monishdeb I checked other places in the code (including the unmerged #12070 and I don't believe any others are affected - using that query to retrieve calc rows is uncommon in our code base & I see no other intersection between the places we do that & the places we check if group by is enabled)