Skip to content

Commit

Permalink
Relational: Implement split query for non-include collections
Browse files Browse the repository at this point in the history
Resolves #21234
Resolves #22283
  • Loading branch information
smitpatel committed Apr 21, 2021
1 parent f9c4e71 commit 6e4f0f2
Show file tree
Hide file tree
Showing 20 changed files with 550 additions and 648 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/EFCore.Relational/Properties/RelationalStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,6 @@
<data name="UnableToBindMemberToEntityProjection" xml:space="preserve">
<value>Unable to bind '{memberType}.{member}' to an entity projection of '{entityType}'.</value>
</data>
<data name="UnableToSplitCollectionProjectionInSplitQuery" xml:space="preserve">
<value>The query has been configured to use '{splitQueryEnumValue}', but contains a collection in the 'Select' call which could not be split into a separate query. Remove '{splitQueryMethodName}' if applied, or add '{singleQueryMethodName}' to the query.</value>
</data>
<data name="UnhandledExpressionInVisitor" xml:space="preserve">
<value>Unhandled expression '{expression}' of type '{expressionType}' encountered in '{visitor}'.</value>
</data>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,5 @@ public override Expression NormalizeQueryableMethod(Expression expression)

return expression;
}

/// <inheritdoc />
public override Expression Process(Expression query)
{
query = base.Process(query);

return _relationalQueryCompilationContext.QuerySplittingBehavior == QuerySplittingBehavior.SplitQuery
? new SplitIncludeRewritingExpressionVisitor().Visit(query)
: query;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Microsoft.EntityFrameworkCore.Query.SqlExpressions
/// not used in application code.
/// </para>
/// </summary>
public class FromSqlExpression : TableExpressionBase
public class FromSqlExpression : TableExpressionBase, ICloneable
{
/// <summary>
/// Creates a new instance of the <see cref="FromSqlExpression" /> class.
Expand Down Expand Up @@ -95,6 +95,9 @@ protected override Expression VisitChildren(ExpressionVisitor visitor)
return this;
}

/// <inheritdoc />
public virtual object Clone() => new FromSqlExpression(Alias, Sql, Arguments);

/// <inheritdoc />
protected override void Print(ExpressionPrinter expressionPrinter)
{
Expand Down
Loading

0 comments on commit 6e4f0f2

Please sign in to comment.