Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#9926 closed (fixed)

Nullable FK to inherited model excludes results when using .select_related()

Reported by: Adam Gomaa Owned by: Malcolm Tredinnick
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Patch to the query regression test demonstrating the problem is attached. I'm pretty lost on getting a fix; it's in some hairy query code.

Present in 1.0 and trunk.

Attachments (1)

2008-12-29-select-related-subclass-null.patch (1.7 KB) - added by Adam Gomaa 8 years ago.

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by Adam Gomaa

comment:1 Changed 8 years ago by Malcolm Tredinnick

Owner: changed from nobody to Malcolm Tredinnick
Status: newassigned

comment:2 Changed 8 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 Changed 8 years ago by Bob Thomas

This looks similar to #9041. One of these could probably be marked a dupe.

comment:4 Changed 8 years ago by Malcolm Tredinnick

Resolution: fixed
Status: assignedclosed

(In [10136]) Fixed #9926 -- Fixes for some select_related() situations.

Using select_related(...) across a nullable relation to a multi-table
model inheritance situation no longer excludes results. Thanks to AdamG
for a test demonstrating part of the problem.

comment:5 Changed 8 years ago by Malcolm Tredinnick

(In [10138]) [1.0.X] Fixed #9926 -- Fixes for some select_related() situations.

Using select_related(...) across a nullable relation to a multi-table
model inheritance situation no longer excludes results. Thanks to AdamG
for a test demonstrating part of the problem.

Backport of r10136 from trunk.

comment:6 Changed 5 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

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