-
Notifications
You must be signed in to change notification settings - Fork 223
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
Nullable Type comparison HasValue with boolean needs parentheses #2090
Comments
I think I found the issue: |
Thanks for reporting and investigating - this is indeed because of 313840d. I did that because dotnet/efcore#23990 was supposed to fix this on the EF Core side, but it seems the fix targets boolean nullable columns only. Opened dotnet/efcore#26652 to do this for non-boolean columns as well, and submitted dotnet/efcore#26653 as a fix. Let's see how it goes with that PR; if it ends up being serviced for EF Core 6.0.1, this will go away. Otherwise I can revert 313840d. |
OK, reverting this for 6.0.1 as a fix won't be going in for EF Core 6.0.1. Opened #2105 to track removing this again once fixed on the EF Core side. |
Hi
The Model looks something like this:
then the query:
the SQL Query produced is:
with $1 being either True or False, depending on the valueFilterNegated.
The Problem is, that the
<>
operator has a stronger binding than theIS NOT NULL
and therefore it tries to compare boolean <> guid which throws:operator does not exist: boolean <> uuid at character
The solution is quite simple, put parantheses:
The text was updated successfully, but these errors were encountered: