mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #7872 -- Fixed a missed case of promoting table joins when using
disjunctive filters. Thanks to Michael Radziej for the failing test case. problem. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8107 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1089,20 +1089,23 @@ class Query(object):
|
||||
join_it = iter(join_list)
|
||||
table_it = iter(self.tables)
|
||||
join_it.next(), table_it.next()
|
||||
table_promote = False
|
||||
for join in join_it:
|
||||
table = table_it.next()
|
||||
if join == table and self.alias_refcount[join] > 1:
|
||||
continue
|
||||
self.promote_alias(join)
|
||||
join_promote = self.promote_alias(join)
|
||||
if table != join:
|
||||
self.promote_alias(table)
|
||||
table_promote = self.promote_alias(table)
|
||||
break
|
||||
for join in join_it:
|
||||
self.promote_alias(join)
|
||||
if self.promote_alias(join, join_promote):
|
||||
join_promote = True
|
||||
for table in table_it:
|
||||
# Some of these will have been promoted from the join_list, but
|
||||
# that's harmless.
|
||||
self.promote_alias(table)
|
||||
if self.promote_alias(table, table_promote):
|
||||
table_promote = True
|
||||
|
||||
self.where.add((alias, col, field, lookup_type, value), connector)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user