1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Refs #32143 -- Adjusted a comment about subquery usage in Query.split_exclude().

This commit is contained in:
Simon Charette 2023-05-31 00:03:46 -04:00 committed by Mariusz Felisiak
parent 0cfcab4eec
commit cfc9c94d97

View File

@ -2035,11 +2035,10 @@ class Query(BaseExpression):
)
condition.add(or_null_condition, OR)
# Note that the end result will be:
# (outercol NOT IN innerq AND outercol IS NOT NULL) OR outercol IS NULL.
# This might look crazy but due to how IN works, this seems to be
# correct. If the IS NOT NULL check is removed then outercol NOT
# IN will return UNKNOWN. If the IS NULL check is removed, then if
# outercol IS NULL we will not match the row.
# NOT EXISTS (inner_q) OR outercol IS NULL
# this might look crazy but due to how NULL works, this seems to be
# correct. If the IS NULL check is removed, then if outercol
# IS NULL we will not match the row.
return condition, needed_inner
def set_empty(self):