Opened 6 years ago

Last modified 6 years ago

#29810 closed Bug

Left outer join using FilteredRelation failed on empty result — at Initial Version

Reported by: Dmitrii Azarenko Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: ORM FilteredRelation
Cc: Can Sarıgöl Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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 test module:

tests.filtered_relation.tests.FilteredRelationTests:

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.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top