#15316: Filter with isnull=False failing when isnull checked on subclass of FK
model
-------------------------------------+-------------------------------------
Reporter: zimnyx | Owner: ethlinn
Type: Bug | Status: new
Milestone: | Component: Database layer
Version: SVN | (models, ORM)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords:
Needs documentation: 0 | Has patch: 1
Patch needs improvement: 1 | Needs tests: 1
UI/UX: 0 | Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by russellm):
* needs_tests: 0 => 1
Comment:
Malcolm and I have just taken a closer look at this, and while it passes
the test, we're not convinced it's the right approach.
The suggested patch is really masking the problem, not fixing it. By
promoting the join, it is prevents the subsequent trim_joins from removing
the extra joins (that are required) -- but the actual problem is with the
trim_joins, because queries with is_null=False shouldn't be promoted
(since once you're saying is_null=False, you're guaranteeing that the
related data exists, so you don't need to use a LEFT OUTER JOIN)
Malcolm's intuition was that if you tried to reproduce this problem with
actual OneToOneFields instead of inheritance, the problem probably
wouldn't exist.
--
Ticket URL: <https://code.djangoproject.com/ticket/15316#comment:7>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.