#24748: GROUP BY clause incorrect with foreign key to self in MySQL
-------------------------------------+-------------------------------------
Reporter: sparkyb | Owner: akaariai
Type: Bug | Status: closed
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: annotate mysql | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tim Graham <timograham@…>):
In [changeset:"d5ce2dd7bc5b797d2e338c4bc6e6f3e339b748e5" d5ce2dd7]:
{{{
#!CommitTicketReference repository=""
revision="d5ce2dd7bc5b797d2e338c4bc6e6f3e339b748e5"
[1.8.x] 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).
Backport of adc57632bc26cc8fe42bdb6aff463f883214980a from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24748#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.08ccc7cb9a4fc2fd89b9483670a6e5fb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.