diff options
| author | Tim Graham <timograham@gmail.com> | 2016-10-13 12:12:58 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-10-13 12:12:58 -0400 |
| commit | 816eae35084a69a76e45439df20f69c7e0ccaef9 (patch) | |
| tree | c579ded45e05d20f1a499fdddb2d27c4e5786da5 | |
| parent | cd09524f27b83c0ca9dabafa81265e8d8abd252a (diff) | |
Removed unused EmptyResultSets in SQLCompilers.
Unused since ed1bcf05158acf4bf4e0189d477b6c762bd0133e.
| -rw-r--r-- | django/db/models/sql/compiler.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 51c3d6e661..e7ccba6151 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -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) |
