mirror of
https://github.com/django/django.git
synced 2025-08-22 19:44:44 +00:00
Refs #33482 -- Fixed QuerySet selecting and filtering againts negated Exists() with empty queryset.
Regression in b7d1da5a62
.
This commit is contained in:
parent
25514b604a
commit
6f185a53a2
2 changed files with 12 additions and 1 deletions
|
@ -1221,7 +1221,10 @@ class Exists(Subquery):
|
|||
)
|
||||
except EmptyResultSet:
|
||||
if self.negated:
|
||||
return '', ()
|
||||
features = compiler.connection.features
|
||||
if not features.supports_boolean_expr_in_select_clause:
|
||||
return "1=1", ()
|
||||
return compiler.compile(Value(True))
|
||||
raise
|
||||
if self.negated:
|
||||
sql = 'NOT {}'.format(sql)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue