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

Produce uncorrelated IN for Contains with nullable item #32575

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

roji
Copy link
Member

@roji roji commented Dec 9, 2023

See #32574 for a description of what this does. After this, Contains over a parameter should never generate correlated EXISTS, only uncorrelated IN.

Fixes #32574

// 2nd-level query pipeline); to need to flow the mutable dictionary in. Note that any modification of parameter values (as
// here) must immediately entail DoNotCache().
Check.DebugAssert(ParameterValues is Dictionary<string, object?>, "ParameterValues isn't a Dictionary");
if (ParameterValues is not Dictionary<string, object?> mutableParameterValues)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is something I intend to clean up in a later PR, i.e. expose the mutable parameter dictionary to SqlNullabilityProcessor.

/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
protected override bool IsCollectionTable(TableExpressionBase table, [NotNullWhen(true)] out Expression? collection)
Copy link
Member Author

Choose a reason for hiding this comment

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

It's not great that providers have to override these two hooks to deal with the provider-specific primitive collection expressions; #32576 tracks doing something better here (that's why these APIs are pubternal for now).

@roji roji marked this pull request as ready for review January 8, 2024 20:04
@roji roji requested a review from maumar January 8, 2024 20:05
@roji roji merged commit 7b712f8 into dotnet:main Jan 9, 2024
7 checks passed
@roji roji deleted the DestroyAllCorrelation branch January 9, 2024 06:28
roji added a commit to roji/efcore that referenced this pull request Jan 10, 2024
roji added a commit to roji/efcore that referenced this pull request Jan 10, 2024
roji added a commit to roji/efcore that referenced this pull request Jan 10, 2024
roji added a commit that referenced this pull request Jan 12, 2024
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.

Contains translates to correlated query when the item is nullable
2 participants