-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
#35200 introduced some changes in RelationalParameterProcessor for EF 10; unfortunately, when the same parameter is referenced twice, deduplication does not work correctly. This causes the incorrect SQL to be generated for test GearsOfWarQueryRelationalTestBase.Parameter_used_multiple_times_take_appropriate_inferred_type_mapping:
var place = "Ephyra's location";
return AssertQuery(
async,
ss => ss.Set<City>().Where(e => e.Nation == place || e.Location == place || e.Location == place));SQL:
SELECT [c].[Name], [c].[Location], [c].[Nation]
FROM [Cities] AS [c]
WHERE [c].[Nation] = @place OR [c].[Location] = @place0 OR [c].[Location] = @placeNote that the second comparison to Location uses the incorrect @place instead of @place0 (Location and Nation have different type mappings).
This is also the cause of the error described in #36917 (comment)
klanderfri, davidroth and alienwareone