Removed unused EmptyResultSets in SQLCompilers.

Unused since ed1bcf0515.
This commit is contained in:
Tim Graham 2016-10-13 12:12:58 -04:00
parent cd09524f27
commit 816eae3508
1 changed files with 1 additions and 9 deletions

View File

@ -482,10 +482,7 @@ class SQLCompiler(object):
not self.query.distinct_fields and
not self.query.select_for_update):
obj.clear_ordering(True)
nested_sql = obj.get_compiler(connection=self.connection).as_sql(subquery=True)
if nested_sql == ('', ()):
raise EmptyResultSet
return nested_sql
return obj.get_compiler(connection=self.connection).as_sql(subquery=True)
def get_default_columns(self, start_alias=None, opts=None, from_parent=None):
"""
@ -1221,11 +1218,6 @@ class SQLAggregateCompiler(SQLCompiler):
Creates the SQL for this query. Returns the SQL string and list of
parameters.
"""
# Empty SQL for the inner query is a marker that the inner query
# isn't going to produce any results. This can happen when doing
# LIMIT 0 queries (generated by qs[:0]) for example.
if not self.query.subquery:
raise EmptyResultSet
sql, params = [], []
for annotation in self.query.annotation_select.values():
ann_sql, ann_params = self.compile(annotation, select_format=True)