Opened 11 years ago
Closed 11 years ago
#21376 closed Bug (fixed)
Regression 2 in query join promotion logic
Reported by: | Tim Graham | Owned by: | Anssi Kääriäinen |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
(master only) I think there's a regression in the following commit - test case that passes before the commit attached. I imagine we may want to introduce a new model rather than modify ObjectC
as done in the patch.
https://github.com/django/django/commit/ecaba3602837d1e02fe1e961f7d3bf9086453259
(regression 1 was #21366)
Attachments (1)
Change History (6)
comment:1 by , 11 years ago
by , 11 years ago
Attachment: | 21376_test.diff added |
---|
comment:3 by , 11 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
Test should now be sufficient, I think.
comment:4 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Is this really a regression? For the query to produce any results objectb must be 1, and if objectb is 1, then LEFT JOIN will not produce any more results. This of course assumes that foreign key constraints are in effect, but that assumption has always been there for the ORM.
Rewriting the test to show that wrong results are produced would make it clear what the regression is. Not producing a left join in a case where it was done earlier isn't a regression.