django1/django/db/models/sql
Anssi Kääriäinen 01b9c3d519 Fixed #16715 -- Fixed join promotion logic for nested nullable FKs
The joins for nested nullable foreign keys were often created as INNER
when they should have been OUTER joins. The reason was that only the
first join in the chain was promoted correctly. There were also issues
with select_related etc.

The basic structure for this problem was:
  A -[nullable]-> B -[nonnull]-> C

And the basic problem was that the A->B join was correctly LOUTER,
the B->C join not.

The major change taken in this patch is that now if we promote a join
A->B, we will automatically promote joins B->X for all X in the query.
Also, we now make sure there aren't ever join chains like:
   a LOUTER b INNER c
If the a -> b needs to be LOUTER, then the INNER at the end of the
chain will cancel the LOUTER join and we have a broken query.

Sebastian reported this problem and did also major portions of the
patch.
2012-08-25 14:14:45 +03:00
..
__init__.py Remove all relative imports. We have always been at war with relative imports. 2011-10-18 00:47:49 +00:00
aggregates.py Fixed #17728 -- When filtering an annotation, ensured the values used in the filter are properly converted to their database representation. This bug was particularly visible with timezone-aware DateTimeFields. Thanks gg for the report and Carl for the review. 2012-02-22 19:40:27 +00:00
compiler.py Fixed #16715 -- Fixed join promotion logic for nested nullable FKs 2012-08-25 14:14:45 +03:00
constants.py Switch a datastructure internal to the ORM to be a set, instead of a dictionary. 2012-04-29 22:18:30 -04:00
datastructures.py Refactored the empty/full result logic in WhereNode.as_sql() 2012-07-01 17:21:34 +03:00
expressions.py Fixed #10154: Allow combining F expressions with timedelta values. 2010-12-22 03:34:04 +00:00
query.py Fixed #16715 -- Fixed join promotion logic for nested nullable FKs 2012-08-25 14:14:45 +03:00
subqueries.py [py3] Ported django.utils.encoding. 2012-08-07 12:00:22 +02:00
where.py [py3] Added Python 3 compatibility for xrange. 2012-07-22 09:29:56 +02:00