#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
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"adc57632bc26cc8fe42bdb6aff463f883214980a" adc57632]:
 {{{
 #!CommitTicketReference repository=""
 revision="adc57632bc26cc8fe42bdb6aff463f883214980a"
 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).
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24748#comment:5>
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.6bcb8fe165d0fe89cbd24dc6e0d48e7e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to