#15145: __in is ignored by an excluded query if foo__in is set to an empty 
iterable
--------------------------------------------------------+-------------------
               Reporter:  melinath                      |         Owner:  nobody
                 Status:  new                           |     Milestone:        
              Component:  Database layer (models, ORM)  |       Version:  SVN   
             Resolution:                                |      Keywords:        
           Triage Stage:  Accepted                      |     Has patch:  0     
    Needs documentation:  0                             |   Needs tests:  0     
Patch needs improvement:  0                             |  
--------------------------------------------------------+-------------------

Comment (by GDorn):

 Some initial investigation:

 One possible source of the problem is in {{{WhereNode.make_atom()}}}.
 When called on an {{{in}}} lookup with an empty list, it raises an
 {{{EmptyResultSet}}} which drops it from the query entirely.  It should
 first check to see if it is part of an exclude, but I'm not sure that
 information is available at that point.

 This should either be a wontfix (check your list before excluding on it),
 or a not-small refactor of the make_atom/as_sql portion of WhereNode to
 pass state into inner nodes of the tree.

 I'll upload a non-solution patch to illustrate the problem.  This breaks
 one other test, of course:
 {{{aggregation_regress.AggregationTests.test_empty_filter_aggregate}}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15145#comment:2>
Django <http://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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to