- First commit to issue fork.
- π³π±Netherlands Lendude Amsterdam
Also, as a curiosity, why is aggregation forced when adding 'HAVE' clauses?
As always in Views, because of 'legacy'.
Not convinced this is a bug, if you are adding things programatically to the query, it would seem fair that it is up to the person adding things that the query they are building remains valid. Fair enough, the fact that this suddenly flips on aggregation is a little unexpected, but does this stop them from making it valid? (I'm asking, I don't know, it might well do).
So the actual fix here might be to not flip on aggregation when adding a having?
- π·π΄Romania rares badita Bucharest
Fair enough, the fact that this suddenly flips on aggregation is a little unexpected, but does this stop them from making it valid?
Technically no. If you account for the 'ORDER BY' fields when computing the non-aggregate fields (or if there is no 'ORDER BY' clause) the query stays valid and returns the same values. The difficult part here would be to programmatically account for the fields, since I did not find an easy way to modify the non-aggreates after they are computed and before the query execution.
So the actual fix here might be to not flip on aggregation when adding a having?
This would be a good fix as well, but it is kept for legacy purposes as you mentioned. I cannot find if the 'GROUP BY' clause was mandatory for 'HAVING' in older versions of SQL, but I suspect that's the reason.
- Merge request !5778Don't switch on aggregation if you add a having clause β (Open) created by Lendude
- Status changed to Needs work
about 1 year ago 12:58pm 12 December 2023 - π³π±Netherlands Lendude Amsterdam
Removed the switching on of aggregation in an MR, let's just see what breaks!
- π³π±Netherlands Lendude Amsterdam
Well that answers that question :D
It seems to be pointless, but test coverage of this area of Views can be really sparse, so the green result doesn't mean too much I fear