summaryrefslogtreecommitdiff
path: root/django/db/models/sql/datastructures.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql/datastructures.py')
-rw-r--r--django/db/models/sql/datastructures.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/django/db/models/sql/datastructures.py b/django/db/models/sql/datastructures.py
index 1edf040e82..069eb1a301 100644
--- a/django/db/models/sql/datastructures.py
+++ b/django/db/models/sql/datastructures.py
@@ -2,6 +2,7 @@
Useful auxiliary data structures for query construction. Not useful outside
the SQL domain.
"""
+from django.core.exceptions import FullResultSet
from django.db.models.sql.constants import INNER, LOUTER
@@ -100,8 +101,11 @@ class Join:
join_conditions.append("(%s)" % extra_sql)
params.extend(extra_params)
if self.filtered_relation:
- extra_sql, extra_params = compiler.compile(self.filtered_relation)
- if extra_sql:
+ try:
+ extra_sql, extra_params = compiler.compile(self.filtered_relation)
+ except FullResultSet:
+ pass
+ else:
join_conditions.append("(%s)" % extra_sql)
params.extend(extra_params)
if not join_conditions: