Fixed #24748 -- Fixed incorrect GROUP BY on MySQL in some queries

When the query's model had a self-referential foreign key, the
compiler.get_group_by() code incorrectly used the self-referential
foreign key's column (for example parent_id) as GROUP BY clause
when it should have used the model's primary key column (id).
This commit is contained in:
Anssi Kääriäinen 2015-05-05 14:44:33 +03:00 committed by Tim Graham
parent be9d645346
commit adc57632bc
4 changed files with 26 additions and 3 deletions

View file

@ -17,3 +17,6 @@ Bugfixes
* Corrected join promotion for ``Case`` expressions. For example, annotating a
query with a ``Case`` expression could unexpectedly filter out results
(:ticket:`24766`).
* Fixed incorrect GROUP BY clause generation on MySQL when the query's model
has a self-referential foreign key (:ticket:`24748`).