Skip to content

Commit

Permalink
Disable InMemory RightJoin support
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Jan 13, 2025
1 parent ed42129 commit 80b1a4f
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,20 @@ static bool IsConvertedToNullable(Expression outer, Expression inner)
return source;
}

/// <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
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
protected override ShapedQueryExpression? TranslateRightJoin(
ShapedQueryExpression outer,
ShapedQueryExpression inner,
LambdaExpression outerKeySelector,
LambdaExpression innerKeySelector,
LambdaExpression resultSelector)
=> null;

/// <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
2 changes: 1 addition & 1 deletion src/EFCore.Relational/Query/SqlExpressionVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ShapedQueryExpression shapedQueryExpression
OuterApplyExpression outerApplyExpression => VisitOuterApply(outerApplyExpression),
ProjectionExpression projectionExpression => VisitProjection(projectionExpression),
TableValuedFunctionExpression tableValuedFunctionExpression => VisitTableValuedFunction(tableValuedFunctionExpression),
RightJoinExpression leftJoinExpression => VisitRightJoin(leftJoinExpression),
RightJoinExpression rightJoinExpression => VisitRightJoin(rightJoinExpression),
RowNumberExpression rowNumberExpression => VisitRowNumber(rowNumberExpression),
RowValueExpression rowValueExpression => VisitRowValue(rowValueExpression),
ScalarSubqueryExpression scalarSubqueryExpression => VisitScalarSubquery(scalarSubqueryExpression),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,8 @@ public override Task Join_include_coalesce_nested(bool async)

public override Task Join_include_conditional(bool async)
=> Task.CompletedTask;

// Right join not supported in InMemory
public override Task Correlated_collections_on_RightJoin_with_predicate(bool async)
=> AssertTranslationFailed(() => base.Correlated_collections_on_RightJoin_with_predicate(async));
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
namespace Microsoft.EntityFrameworkCore.Query;

public class NorthwindEFPropertyIncludeQueryInMemoryTest(NorthwindQueryInMemoryFixture<NoopModelCustomizer> fixture)
: NorthwindEFPropertyIncludeQueryTestBase<NorthwindQueryInMemoryFixture<NoopModelCustomizer>>(fixture);
: NorthwindEFPropertyIncludeQueryTestBase<NorthwindQueryInMemoryFixture<NoopModelCustomizer>>(fixture)
{
// Right join not supported in InMemory
public override Task Include_collection_with_right_join_clause_with_filter(bool async)
=> AssertTranslationFailed(() => base.Include_collection_with_right_join_clause_with_filter(async));
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
namespace Microsoft.EntityFrameworkCore.Query;

public class NorthwindIncludeNoTrackingQueryInMemoryTest(NorthwindQueryInMemoryFixture<NoopModelCustomizer> fixture)
: NorthwindIncludeNoTrackingQueryTestBase<NorthwindQueryInMemoryFixture<NoopModelCustomizer>>(fixture);
: NorthwindIncludeNoTrackingQueryTestBase<NorthwindQueryInMemoryFixture<NoopModelCustomizer>>(fixture)
{
// Right join not supported in InMemory
public override Task Include_collection_with_right_join_clause_with_filter(bool async)
=> AssertTranslationFailed(() => base.Include_collection_with_right_join_clause_with_filter(async));
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
namespace Microsoft.EntityFrameworkCore.Query;

public class NorthwindIncludeQueryInMemoryTest(NorthwindQueryInMemoryFixture<NoopModelCustomizer> fixture)
: NorthwindIncludeQueryTestBase<NorthwindQueryInMemoryFixture<NoopModelCustomizer>>(fixture);
: NorthwindIncludeQueryTestBase<NorthwindQueryInMemoryFixture<NoopModelCustomizer>>(fixture)
{
// Right join not supported in InMemory
public override Task Include_collection_with_right_join_clause_with_filter(bool async)
=> AssertTranslationFailed(() => base.Include_collection_with_right_join_clause_with_filter(async));
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public override Task SelectMany_with_client_eval_with_constructor(bool async)
// Joins between sources with client eval. Issue #21200.
=> Assert.ThrowsAsync<NotImplementedException>(() => base.SelectMany_with_client_eval_with_constructor(async));

// Right join not supported in InMemory
public override Task RightJoin(bool async)
=> AssertTranslationFailed(() => base.RightJoin(async));

public override async Task Join_local_collection_int_closure_is_cached_correctly(bool async)
{
var ids = new uint[] { 1, 2 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
namespace Microsoft.EntityFrameworkCore.Query;

public class NorthwindStringIncludeQueryInMemoryTest(NorthwindQueryInMemoryFixture<NoopModelCustomizer> fixture)
: NorthwindStringIncludeQueryTestBase<NorthwindQueryInMemoryFixture<NoopModelCustomizer>>(fixture);
: NorthwindStringIncludeQueryTestBase<NorthwindQueryInMemoryFixture<NoopModelCustomizer>>(fixture)
{
// Right join not supported in InMemory
public override Task Include_collection_with_right_join_clause_with_filter(bool async)
=> AssertTranslationFailed(() => base.Include_collection_with_right_join_clause_with_filter(async));
}

0 comments on commit 80b1a4f

Please sign in to comment.