mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +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:
parent
be9d645346
commit
adc57632bc
4 changed files with 26 additions and 3 deletions
|
@ -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`).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue