Fix #37605: Handle null values in IN expressions when using OPENJSON …#37600
Fix #37605: Handle null values in IN expressions when using OPENJSON …#37600BurakBebek1 wants to merge 3 commits intodotnet:mainfrom
Conversation
…NJSON on SQL Server
|
@dotnet-policy-service agree |
|
@BurakBebek1 above you referenced issue #37494, which seems unrelated. If there's a bug here and there isn't yet an issue tracking it, can you please open a new issue with a clear repro (currently behavior/SQL and how it's wrong)? |
|
@roji Hi, |
|
@BurakBebek1 thanks, I finally got around to looking at this. Your proposed fix has some issues:
More generally, though, the null handling logic that your PR reimplements already exists in SqlNullabilityProcessor; it's not good to reimplement/duplicate that specifically for the case of SQL Server with lots of parameters. That incidentally had a separate, completely unrelated bug (the InvalidCastOperation) that I looked into as well, and which wasn't directly related to the SQL Server parameters-over-limit problem (I reproduced it in a separate test). After fixing that as well as the I've opened #37674 with the fixes - please take a look; thanks for submitting your PR - I'll close it in favor of #37674. |

…on SQL Server
Summary of the changes
nullvalues when translating collection parameters usingOPENJSONon SQL Server.nullelement, the generated SQL now includes anOR [column] IS NULLclause to ensureNULLrows are correctly matched, consistent with LINQContainsbehavior.Fixes #37605