Changes between Initial Version and Version 1 of Ticket #23557, comment 1


Ignore:
Timestamp:
Sep 26, 2014, 6:50:07 PM (10 years ago)
Author:
Josh Smeaton

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23557, comment 1

    initial v1  
    44
    55I would propose that the MySQL backend should add the order by columns into the group by list.
     6
     7http://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
     9It 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.
Back to Top