#13356: EmptyResultSet when using annotation and empty filter
---------------------------------------------------+------------------------
 Reporter:  Petr Marhoun <petr.marh...@gmail.com>  |       Owner:  nobody    
   Status:  new                                    |   Milestone:            
Component:  Database layer (models, ORM)           |     Version:  SVN       
 Keywords:                                         |       Stage:  Unreviewed
Has_patch:  0                                      |  
---------------------------------------------------+------------------------
 Following code works :

 {{{
 #!python
 from django.contrib.auth.models import User
 from django.db.models import Count
 User.objects.filter(id__in=[]).annotate(Count('groups'))
 []
 User.objects.filter(id__in=[]).count()
 0
 }}}

 But following code raise EmptyResultSet:

 {{{
 #!python
 User.objects.filter(id__in=[]).annotate(Count('groups')).count()
 }}}

 (I don't know what is right - Error or empty response. But it is sure that
 current state is inconsistent.)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13356>
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-upda...@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