Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ private readonly IDictionary<FromSqlExpression, Expression> _visitedFromSqlExpre
private ParametersCacheDecorator _parametersDecorator;
private ParameterNameGenerator _parameterNameGenerator;

private static readonly bool UseOldBehavior37189 =
AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue37189", out var enabled37189) && enabled37189;

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
Expand Down Expand Up @@ -117,7 +120,7 @@ private SqlParameterExpression VisitSqlParameter(SqlParameterExpression paramete
&& (existingTypeMapping.Converter is null && typeMapping.Converter is null
|| existingTypeMapping.Converter is not null && existingTypeMapping.Converter.Equals(typeMapping.Converter)))
{
return parameter;
return UseOldBehavior37189 ? parameter : existingParameter;
}

var uniquifiedName = UniquifyParameterName(parameter.Name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected override Expression VisitChildren(ExpressionVisitor visitor)
if (newPath is null)
{
newPath = new PathSegment[Path.Count];
for (var j = 0; j < i; i++)
for (var j = 0; j < i; j++)
{
newPath[j] = Path[j];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8457,7 +8457,7 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr

SELECT [c].[Name], [c].[Location], [c].[Nation]
FROM [Cities] AS [c]
WHERE [c].[Nation] = @place OR [c].[Location] = @place0 OR [c].[Location] = @place
WHERE [c].[Nation] = @place OR [c].[Location] = @place0 OR [c].[Location] = @place0
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10889,7 +10889,7 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr

SELECT [c].[Name], [c].[Location], [c].[Nation]
FROM [Cities] AS [c]
WHERE [c].[Nation] = @place OR [c].[Location] = @place0 OR [c].[Location] = @place
WHERE [c].[Nation] = @place OR [c].[Location] = @place0 OR [c].[Location] = @place0
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9201,7 +9201,7 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr

SELECT [c].[Name], [c].[Location], [c].[Nation]
FROM [Cities] AS [c]
WHERE [c].[Nation] = @place OR [c].[Location] = @place0 OR [c].[Location] = @place
WHERE [c].[Nation] = @place OR [c].[Location] = @place0 OR [c].[Location] = @place0
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2918,7 +2918,7 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr

SELECT [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd], [c].[PeriodStart]
FROM [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c]
WHERE [c].[Nation] = @place OR [c].[Location] = @place0 OR [c].[Location] = @place
WHERE [c].[Nation] = @place OR [c].[Location] = @place0 OR [c].[Location] = @place0
""");
}

Expand Down