-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
dev/core/issues/577: Activity Summary report fix for db column count error with section header (without ONLY_FULL_GROUP_BY) #13540
Conversation
(Standard links)
|
@davejenx this looks good - I think I've stuck my nose into it a few times & concluded it's good but needs a test - the class we add them to is api_v3_ReportTemplateTest |
@monishdeb it might have just been this - the bigger one seems to be non-activity-report |
@davejenx any hope of getting a test on this |
@eileenmcnaughton Will try to find some time for that this week. |
@eileenmcnaughton Looking in api_v3_ReportTemplateTest, I see two mentions of "activitySummary":
|
@davejenx looks like testActivitySummary should be renamed. If we can get the activitySummary out of $reportsToSkip that would be enough for this round / pr You can see I have a PR doing that for one of the others #14098 - generally it's all about getting stuff into shared functions like beginPostProcessCommon and buildQuery |
@eileenmcnaughton Thanks for the pointers. To see what we're dealing with, I tried removing activitySummary from $reportsToSkip in getReportTemplates(), then running ReportTemplateTest.php . There were two failures (vs none with activitySummary skipped): one related and in line with the description in $reportsToSkip, the other not directly related. Failure on unrelated report:
This occurs on subsequent test runs even if I re-comment-out 'activitySummary', so appears irrelevant. Presumably logging db isn't getting reset. Failure on activitySummary: This indicates that {$this->_tempTableName} is not set, in line with the description in $reportsToSkip: |
@davejenx I feel like most of what is in the postProcess function should be in the buildQuery function instead - which would solve the test problem & probably mean postProcess would not need to be overwritten & a more targetted overwrite could happen I added #14364 as a very minor cleanup to help a little |
Thanks @eileenmcnaughton . I wasn't clear which other methods get called when statistics() is called via API from the test framework. I've created #14375 restructuring Activity Summary so that it's no longer skipped from unit tests. |
@davejenx I removed 'needs test' & added 'has test' since you've improved testing in a separate PR & while it doesn't specifically cover this fix I think it meets the 'improves test cover' requirement It still needs rebasing |
Rebasing and reapplying the fix leaves the fix no longer working, needs more work. |
…rting uses Section Header (without ONLY_FULL_GROUP_BY)
c2164a9
to
a6d5eae
Compare
@eileenmcnaughton I have rebased and applied some further fixes:
Tested successfully on local dmaster. Note that this does NOT fix problems with ONLY_FULL_GROUP_BY described in dev/core/issues/578. |
Jenkins test this please (not this Jenkins, the fella in the suit.) |
@davejenx yes - agree this fixes - I'm gonna merge this & also put up a quick PR to disable FGB mode in this report (which we do on existing breakage but we expect new code to be FGB compliant) |
Overview
See dev/core/issues/577: Fatal db error in Activity Summary report when Sorting uses Section Header (without ONLY_FULL_GROUP_BY).
A fatal db error occurs in Activity Summary report when sorting by a field that has not been selected in Columns, if Section Header is checked. This occurs with or without ONLY_FULL_GROUP_BY.
Steps to replicate:
Before
DB Error: value count on row
Database Error Code: Column count doesn't match value count at row 1, 1136
After
Report runs, no db error.
Technical Details
Order-by columns not selected for display were being added to SELECT but not to the temporary table columns. This PR rectifies that.
Comments
Note that if you are using ONLY_FULL_GROUP_BY, after getting past this error you will be hit by dev/core/issues/578 Fatal db error in Activity Summary report for some Sorting fields (with ONLY_FULL_GROUP_BY).