-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
DB query is executed with the parameters of the previous query #7115
Comments
Assigning this to @anpete for investigation in the 1.1.1 milestone based on the potential severity. We can discuss it next time we triage. |
…query - Fixes an issue in ExpressionEqualityComparer where we would incorrectly determine equality for constant EnumerableQuery nodes.
@anpete was this fixed pushed to the 1.1.1 branch? Should we reopen the issue? |
Yep, re-opened. |
This patch bug is approved. Please use the normal code review process w/ a PR and make sure the fix is in the correct branch, then close the bug and mark it as done. |
@anpete closing again since the fix is in and approved for the patch. Please reopen if necessary. |
✅ Verified |
Steps to reproduce
Minimal solution: https://github.com/linnando/EFCoreTest
Model.cs contains the description of the model copied from https://docs.microsoft.com/en-us/ef/core/index
To reproduce the bug:
The issue
TestGetByQueryableUrl outputs 1 and 1 instead of expected 1 and 0. In the debug mode, I see that in both cases, the same query is sent to the database: "SELECT COUNT(*) FROM [Blogs] AS [blog] WHERE [blog].[Url] IN (N'test')". Although in the second time another parameter "wrong_url" is given, the query is still sent to the database with parameter "test" instead (probably, somehow cached from the previous query).
In contrast, TestGetByEnumerableUrl works correctly (sends correct queries and outputs 1 and 0), although it differs from the first test only in the signature of the auxiliary method (GetBlogsByEnumerableUrl).
Further technical details
EF Core version: 1.1.0
Operating system: Windows 10 Enterprise N
Visual Studio version: VS Enterprise 2015 (14.0.25431.01 Update 3)
The text was updated successfully, but these errors were encountered: