Skip to content

Commit

Permalink
Fix to #24671 - Relational: No tests for TranslateContains path
Browse files Browse the repository at this point in the history
All Contains calls are converted to Any with predicate (which allows to handle null semantics) so this code never gets but fixing this tiny bug, just in case. We were not setting the cardinality of the contains translation to single result, so the translation would have failed, if it wasn't converted to Any and therefore (correctly) being handled by it's translation code.

Fixes #24671
  • Loading branch information
maumar committed Sep 1, 2021
1 parent 6817274 commit 5c6b726
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ private static ShapedQueryExpression CreateShapedQueryExpression(IEntityType ent
selectExpression.ClearOrdering();
}

// TODO: See issue #24671
if (source.ShaperExpression is ProjectionBindingExpression projectionBindingExpression)
{
var projection = selectExpression.GetProjection(projectionBindingExpression);
Expand All @@ -323,7 +322,7 @@ private static ShapedQueryExpression CreateShapedQueryExpression(IEntityType ent

translation = _sqlExpressionFactory.In(translation, selectExpression, false);

return new ShapedQueryExpression(
return source.Update(
_sqlExpressionFactory.Select(translation),
Expression.Convert(
new ProjectionBindingExpression(source.QueryExpression, new ProjectionMember(), typeof(bool?)),
Expand Down

0 comments on commit 5c6b726

Please sign in to comment.