#15834 closed Bug (duplicate)
Django ORM transforming inner join to outer joins depending on Q() ordering
Reported by: | djcoin | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.2 |
Severity: | Normal | Keywords: | orm, outer join, inner join, join, Q, filter |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
I don't have the time yet to completely isolate the bug/reproducing steps, yet im almost sure there is a bug related to this.
You may see sql log files attached as changes are performed to my code an thus query hit the postgres database.
Briefly:
I created a more or less complex queryset.
I have to Q filter to apply to it: say Q1 and Q2.
Filtering by the one or the other not at the same time yields results.
But when both are combined with an or, Q1 | Q2, results changes.
In one case I do not have any result in the other I have.
Printing postgres log, it seems that in one case, some joins are made inner (no results then) in the other case, outer joins are made.
Summary: difference between the two below request (inner join to outer join):
queryset = queryset.filter(event_descr_filter | op_filter)
queryset = queryset.filter(op_filter | event_descr_filter)
See all the files attached.
You wont be able to reproduce the bug, but it may gives you clues.
Cheers,
Simon
Attachments (1)
Change History (4)
by , 14 years ago
Attachment: | bug_orm_q_filters.tgz added |
---|
comment:2 by , 14 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Include cleaned up but not working src files, log of postgres, details of Q filter leading to the bug.