Skip to content

Conversation

@angelamayxie
Copy link
Contributor

@angelamayxie angelamayxie commented Nov 12, 2025

fixes dolthub/dolt#10070

Filters that evaluate to null in an EXISTS or IN subquery context should be treated the same as false. When hoisted out of the subquery, nullable filters need to be wrapped in an IsTrue expression to ensure that they are still treated the same as false when they evaluate to null.

Not doing so was causing a bug where rows were being dropped from NOT EXISTS if the filter evaluated to null. Since the filter expression was evaluated to null, the NOT expression wrapping it would evaluate to null as well. This caused the filter iterator to reject the row because it did not evaluate to true. Wrapping the filter expression with IsTrue ensures that nulls are then evaluated to false, which will then evaluate to true with NOT.

@angelamayxie angelamayxie marked this pull request as ready for review November 12, 2025 22:44
@angelamayxie angelamayxie requested a review from jycor November 12, 2025 22:44
Copy link
Contributor

@jycor jycor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@angelamayxie angelamayxie merged commit 7b8fb20 into main Nov 12, 2025
8 of 9 checks passed
@angelamayxie angelamayxie deleted the angela/nullnotexists branch November 12, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected Result in ANTI-JOIN

3 participants