#30244: Aggregate functions with filter have bug with state mutation in
get_source_expressions() method
-------------------------------------+-------------------------------------
               Reporter:  gtors      |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  2.1
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Django 2.1.7

 {{{
 In [27]: s = Sum('x', filter=Q(x=1))

 In [28]: s.get_source_expressions()
 Out[28]: [F(x), <Q: (AND: ('x', 1))>]

 In [29]: s.get_source_expressions()
 Out[29]: [F(x), <Q: (AND: ('x', 1))>, <Q: (AND: ('x', 1))>]

 In [30]: s.get_source_expressions()
 Out[30]: [F(x), <Q: (AND: ('x', 1))>, <Q: (AND: ('x', 1))>, <Q: (AND:
 ('x', 1))>]
 }}}

 Each call of `get_source_expressions` on instance of aggregate function
 causes list element duplication.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30244>
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/048.2c182c87a74c4d070fc1a738cf058d24%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to