#29810: Left outer join using FilteredRelation failed on empty result
-------------------------------------+-------------------------------------
               Reporter:  dvazar     |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  2.0
  layer (models, ORM)                |       Keywords:  ORM
               Severity:  Normal     |  FilteredRelation
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 When I try to join table with using `FilteredRelation` clause it failed if
 the result of a joined table is null.
 This error can be reproduce by adding the following test case to the
 corresponding
 [https://github.com/django/django/blob/2.0/tests/filtered_relation/tests.py#L9
 test module]:
 {{{#!div style="font-size: 80%"
 tests.filtered_relation.tests.FilteredRelationTests:
   {{{#!python
 def test_select_related_empty_join(self):
     self.assertFalse(
         Author.objects.annotate(
             empty_join=FilteredRelation('book', condition=Q(
                 book__title='not existing book')),
         ).select_related('empty_join')
     )
 }}}
 }}}

 This bug is typical since version 2.0 and exists until now.

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

Reply via email to