-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
String.CompareTo emits unicode literal against varchar column #13906
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
punted-for-3.0
type-bug
Milestone
Comments
smitpatel
added
the
verify-fixed
This issue is likely fixed in new query pipeline.
label
Jun 6, 2019
Generated SQL in 3.1 SELECT [b].[Id], [b].[Value]
FROM [Blogs] AS [b]
WHERE CASE
WHEN [b].[Value] = 'test' THEN 0
WHEN [b].[Value] > 'test' THEN 1
WHEN [b].[Value] < 'test' THEN -1
END = 0 |
smitpatel
added
add-regression-test
and removed
punted-for-3.1
verify-fixed
This issue is likely fixed in new query pipeline.
labels
Dec 9, 2019
I will send this over to the project team where this bug was discovered and see if they can verify this is fixed. |
ajcvickers
added
propose-punt
good first issue
This issue should be relatively straightforward to fix.
labels
Mar 10, 2020
simplification of CASE blocks is tracked by #16092 |
maumar
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
May 19, 2020
maumar
removed
add-regression-test
good first issue
This issue should be relatively straightforward to fix.
poachable
labels
May 19, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
punted-for-3.0
type-bug
Seems related to #4978, #8370, and #4686, but logging it here because it's a different use case.
EF is correctly emitting a unicode or non-unicode literal when used directly like this:
query.Where(x => x.ID == "test")
But not with
String.CompareTo
, like this:query.Where(x => x.ID.CompareTo("test") == 0)
This means any inequality comparisons (i.e. paging) off of a string field when it is
varchar
will not use the index on the column, because it is not possible to write a string comparison with the>
operator.EF Core version: 2.1.4
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2017 15.9
The text was updated successfully, but these errors were encountered: