You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List<string> col = null;
var q = db.MyEntity.Where(e => col.Contains("someval"));
Generates SQL like
select * from t where a in ( SELECT [u].[value] FROM OPENJSON( null ) AS [u] )
Which fails on SQL Server with:
Msg 468, Level 16, State 9, Line 16
Cannot resolve the collation conflict between "Latin1_General_BIN2" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.
This does not depend on the database collation, whether the database collation matches the server collation, or whether partial database containment is on.
This might also be a SQL Server bug, but probably best to fix it here. SQL docs say that the collation of value derives from the collation of the expression passed to OPENJSON. Not sure why it's picking up Latin1_General_BIN2.
Using a empty string literal resolves the issue, so generated code should probably look like:
select * from t where a in ( SELECT [u].[value] FROM OPENJSON( N'') AS [u] )
This was reported by a user over on reddit:
Bug description
Code like:
Generates SQL like
select * from t where a in ( SELECT [u].[value] FROM OPENJSON( null ) AS [u] )
Which fails on SQL Server with:
Msg 468, Level 16, State 9, Line 16
Cannot resolve the collation conflict between "Latin1_General_BIN2" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.
This does not depend on the database collation, whether the database collation matches the server collation, or whether partial database containment is on.
This might also be a SQL Server bug, but probably best to fix it here. SQL docs say that the collation of value derives from the collation of the expression passed to OPENJSON. Not sure why it's picking up Latin1_General_BIN2.
Using a empty string literal resolves the issue, so generated code should probably look like:
select * from t where a in ( SELECT [u].[value] FROM OPENJSON( N'') AS [u] )
This was reported by a user over on reddit:
Collation issue when running web app in Docker container
Your code
Stack traces
Verbose output
EF Core version
9.0.1
Database provider
No response
Target framework
No response
Operating system
No response
IDE
No response
The text was updated successfully, but these errors were encountered: