mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
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:
committed by
Tim Graham
parent
be9d645346
commit
adc57632bc
@@ -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`).
|
||||
|
||||
Reference in New Issue
Block a user