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

More superflous null checks in EF Core 3.1 preview #18733

Closed
julielerman opened this issue Nov 3, 2019 · 4 comments
Closed

More superflous null checks in EF Core 3.1 preview #18733

julielerman opened this issue Nov 3, 2019 · 4 comments
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported

Comments

@julielerman
Copy link

In case you are still trying to hammer these out via something related to #18694 , some simple queries are still adding in IS NOT NULL where I would not expect them.

I have checked these using 3.1.0-preview2.19525.5 as well. (Latest daily build)

Example 1, hard coded predicate

context.People.Where(p=>p.Name=="Erik").ToList();

Results in
the following predicate in the SQL (SQL Server and also SQLite)
WHERE ([s].[Name] = N'Erik') AND [s].[Name] IS NOT NULL

When using a variable, the parameterized query has definitely reduced the # of null checks (there were 4!) that we saw in EF Core 3.0 but this still seems extraneous. (I ran it by someone with much stronger DB knowledge than myself and he agreed). Hint as to who that as lies in my sample. :)

WHERE ([s].[Name] =@__name_0) AND [s].[Name] IS NOT NULL

Further technical details

EF Core version: 3.1.0-preview2.19525.5
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: (e.g. .NET Core 3.0)
Operating system: Windows 10
IDE: (e.g. Visual Studio 2019 16.3.6)

@smitpatel
Copy link
Contributor

Latest daily builds are preview3 but I am not sure if they are being published properly. I am sure the fix is not in preview2 builds.

@julielerman
Copy link
Author

Hmm. I used the version shown on Nuget explicitly. I'll see what happens with "3.1.0-*" and the fees in my Nuget.config file.

@julielerman
Copy link
Author

that and variations aren't giving me preview3 so maybe not published. Anyway...i'll just carry on. You can close this if you know you've already gotten to it.

@julielerman
Copy link
Author

I now have 3.1.0-preview3.19553.2 and can see both of my examples now have no NULL checks in them.
closing and also making sure @ErikEJ sees this :)

@ajcvickers ajcvickers added closed-no-further-action The issue is closed and no further action is planned. and removed type-bug labels Nov 4, 2019
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported
Projects
None yet
Development

No branches or pull requests

3 participants