Changes between Initial Version and Version 1 of Ticket #23557, comment 1
- Timestamp:
- Sep 26, 2014, 6:50:07 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23557, comment 1
initial v1 4 4 5 5 I would propose that the MySQL backend should add the order by columns into the group by list. 6 7 http://dev.mysql.com/doc/refman/5.0/en/group-by-extensions.html describes the logic behind not requiring columns in the group by statement, but calls out that queries are non-deterministic unless the "free" column is unique for the group. This is a foot gun as far as I'm concerned, unless you *really* know what you're doing. I think it applies more to hand crafted queries rather than queries generated from an ORM. 8 9 It also looks like columns in the ORDER BY that aren't referenced in the GROUP BY have no affect, except possibly choosing a deterministic value for the "free" column in the select list, which django doesn't support anyway.