Opened 7 years ago

Closed 6 years ago

Last modified 4 years ago

#9926 closed (fixed)

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

Reported by: AdamG Owned by: mtredinnick
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 AdamG 7 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to mtredinnick
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 7 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by bthomas

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

comment:4 Changed 6 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 6 years ago by mtredinnick

(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 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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