diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 6629a1fd51..2563eebd76 100644
a
|
b
|
class Query(BaseExpression):
|
2081 | 2081 | self.deferred_loading = existing.union(field_names), True |
2082 | 2082 | else: |
2083 | 2083 | # Remove names from the set of any existing "immediate load" names. |
2084 | | self.deferred_loading = existing.difference(field_names), False |
| 2084 | existing = existing.difference(field_names) |
| 2085 | if not existing: |
| 2086 | self.clear_deferred_loading() |
| 2087 | else: |
| 2088 | self.deferred_loading = existing, False |
2085 | 2089 | |
2086 | 2090 | def add_immediate_loading(self, field_names): |
2087 | 2091 | """ |