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

Exclude Object when checking for DbContext in query filters #18770

Merged
merged 1 commit into from
Nov 11, 2019

Conversation

roji
Copy link
Member

@roji roji commented Nov 5, 2019

Fixes #18759

Ports #18761 to 3.1.

@Pilchie
Copy link
Member

Pilchie commented Nov 6, 2019

@ajcvickers / @roji can you fill out the ask mode template with customer scenario, workarounds, etc?

@roji
Copy link
Member Author

roji commented Nov 6, 2019

Description

Since 3.0, null constants in query filters get incorrectly parameterized and cause query translation failure unless compared against a type that defines an equality operator (==).

Customer Impact

Query failure when defining a query filter comparing either navigation properties to null, or non-navigation reference properties such as byte arrays, spatial types which don't define an equality operator. Filters that compare to null are common.

How found

Customer-reported (#18759)

Test coverage

We had a test for an extremely close scenario, but unfortunately our test entity types define an equality operator (==), so the bug wasn't triggered.

Regression?

Yes, from 2.2.

Risk

Risk is very small - the fix is adding a single check to exclude Object in a visitor (to prevent the null constant from mistakenly being identified as the context type).

@leecow
Copy link
Member

leecow commented Nov 7, 2019

Approved for GA. Please hold for branch to open.

@ajcvickers ajcvickers removed this from the 3.1.0-preview3 milestone Nov 8, 2019
@wtgodbe wtgodbe merged commit 53779f7 into release/3.1 Nov 11, 2019
@wtgodbe wtgodbe deleted the ObjectIdentifiedAsContext3.1 branch November 11, 2019 17:47
@roji
Copy link
Member Author

roji commented Nov 15, 2019

@smitpatel addressed in #18918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants