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 #19499 - Query: null semantics not applied on subquery.Contains(null) #19744

Merged
merged 1 commit into from
Mar 4, 2020

Commits on Mar 4, 2020

  1. Fix to #19499 - Query: null semantics not applied on subquery.Contain…

    …s(null)
    
    We used to translate this into `NULL IN subquery` pattern, but this doesn't work because it doesn't match if the subquery also contains null.
    Fix is to convert this into subquery.Any(e => e == NULL), which translates to EXISTS with predicate and we can correctly apply null semantics.
    Also it allows us to translate contains on entities with composite keys.
    
    Also made several small fixes:
    - marked EXISTS as never nullable for purpose of null semantics,
    - marked IN as never nullable for purpose of null semantics when both the subquery projection element and the item expression are not nullable,
    - optimized EXISITS (subquery) and IN (subquery) with predicate that resolves to false, directly into false, since empty subquery never exisits and doesn't contain any results,
    - improves expression printer output for IN expression in the subquery scenario.
    maumar committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    b84eec1 View commit details
    Browse the repository at this point in the history