django1/django/db
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
..
backends [py3] Removed duplicate imports. 2012-08-23 10:16:16 +02:00
models Fixed #16715 -- Fixed join promotion logic for nested nullable FKs 2012-08-25 14:14:45 +03:00
__init__.py Fixed #17258 -- Moved `threading.local` from `DatabaseWrapper` to the `django.db.connections` dictionary. This allows connections to be explicitly shared between multiple threads and is particularly useful for enabling the sharing of in-memory SQLite connections. Many thanks to Anssi Kääriäinen for the excellent suggestions and feedback, and to Alex Gaynor for the reviews. Refs #2879. 2011-12-16 13:40:19 +00:00
transaction.py Removed with_statement imports, useless in Python >= 2.6. Refs #17965. Thanks jonash for the patch. 2012-03-30 08:02:08 +00:00
utils.py [py3] Replaced basestring by six.string_types. 2012-07-22 09:29:54 +02:00