Removed unused EmptyResultSets in SQLCompilers.
Unused since ed1bcf0515
.
This commit is contained in:
parent
cd09524f27
commit
816eae3508
|
@ -482,10 +482,7 @@ class SQLCompiler(object):
|
||||||
not self.query.distinct_fields and
|
not self.query.distinct_fields and
|
||||||
not self.query.select_for_update):
|
not self.query.select_for_update):
|
||||||
obj.clear_ordering(True)
|
obj.clear_ordering(True)
|
||||||
nested_sql = obj.get_compiler(connection=self.connection).as_sql(subquery=True)
|
return obj.get_compiler(connection=self.connection).as_sql(subquery=True)
|
||||||
if nested_sql == ('', ()):
|
|
||||||
raise EmptyResultSet
|
|
||||||
return nested_sql
|
|
||||||
|
|
||||||
def get_default_columns(self, start_alias=None, opts=None, from_parent=None):
|
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
|
Creates the SQL for this query. Returns the SQL string and list of
|
||||||
parameters.
|
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 = [], []
|
sql, params = [], []
|
||||||
for annotation in self.query.annotation_select.values():
|
for annotation in self.query.annotation_select.values():
|
||||||
ann_sql, ann_params = self.compile(annotation, select_format=True)
|
ann_sql, ann_params = self.compile(annotation, select_format=True)
|
||||||
|
|
Loading…
Reference in New Issue