﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
15834	Django ORM transforming inner join to outer joins depending on Q() ordering	djcoin	nobody	"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"	Bug	closed	Uncategorized	1.2	Normal	duplicate	orm, outer join, inner join, join, Q, filter		Unreviewed	0	0	0	0	0	0
