#16025: distinct does not apply to aggregated querysets
-------------------------------------+-------------------------------------
     Reporter:  Michael              |                    Owner:  (none)
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.6
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

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


Comment:

 I'm not sure when this got fixed but I can confirm that the `DISTINCT` is
 now applied to the subquery aggregated over by the expression provided in
 the `aggregate` call and not on the outer query which was effectively
 useless. I suspect that #23875 fixed it by moving the
 
[https://github.com/django/django/commit/c7fd9b242d2d63406f1de6cc3204e35aaa025233
 #diff-0edd853580d56db07e4020728d59e193R339 distinct special casing] from
 the `get_count` method to the `get_aggregation` one.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16025#comment:10>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.d45d5b5f646b932c85684312123e4fe8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to