Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to #23761 - UseRelationalNulls causes subquery to include NOT IN (NULL, x) #23856

Merged
merged 1 commit into from
Jan 15, 2021

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Jan 12, 2021

We do optimization which combines comparisons based on the same property into IN and NOT IN. Problem is that if the comparisons contain nulls, we add those into the list of IN values, generating queries like a IN (1, 2, NULL). In normal circumstances, during null semantics processing we extract these nulls and produce correct IS NULL / IS NOT NULL calls, however when useRelationalNulls is enabled, we don't run null semantics visitor and therefore don't "fix" the IN expressions.

Fix is to only apply the initial optimization for c# null semantics.

Fixes #23761

@maumar maumar requested a review from a team January 12, 2021 03:41
@maumar maumar force-pushed the fix23761 branch 2 times, most recently from 16449ac to 54d35bc Compare January 14, 2021 06:05
…(NULL, x)

We do optimization which combines comparisons based on the same property into IN and NOT IN. Problem is that if the comparisons contain nulls, we add those into the list of IN values, generating queries like  a IN (1, 2, NULL). In normal circumstances, during null semantics processing we extract these nulls and produce correct IS NULL / IS NOT NULL calls, however when useRelationalNulls is enabled, we don't run null semantics visitor and therefore don't "fix" the IN expressions.

Fix is to only apply the initial optimization for c# null semantics.

Fixes #23761
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.

UseRelationalNulls causes subquery to include NOT IN (NULL, x)
2 participants