Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InMemory: Preserve type of value buffer expressions when doing Join/S… #17528

Merged
merged 1 commit into from
Aug 30, 2019
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
15 changes: 9 additions & 6 deletions src/EFCore.InMemory/Query/Internal/InMemoryQueryExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,9 @@ public virtual void AddInnerJoin(
var readExpressionMap = new Dictionary<IProperty, Expression>();
foreach (var property in GetAllPropertiesInHierarchy(entityProjection.EntityType))
{
resultValueBufferExpressions.Add(replacingVisitor.Visit(entityProjection.BindProperty(property)));
readExpressionMap[property] = CreateReadValueExpression(property.ClrType, index++, property);
var replacedExpression = replacingVisitor.Visit(entityProjection.BindProperty(property));
resultValueBufferExpressions.Add(replacedExpression);
readExpressionMap[property] = CreateReadValueExpression(replacedExpression.Type, index++, property);
}
projectionMapping[projection.Key.Prepend(outerMemberInfo)]
= new EntityProjectionExpression(entityProjection.EntityType, readExpressionMap);
Expand All @@ -494,8 +495,9 @@ public virtual void AddInnerJoin(
var readExpressionMap = new Dictionary<IProperty, Expression>();
foreach (var property in GetAllPropertiesInHierarchy(entityProjection.EntityType))
{
resultValueBufferExpressions.Add(replacingVisitor.Visit(entityProjection.BindProperty(property)));
readExpressionMap[property] = CreateReadValueExpression(property.ClrType, index++, property);
var replacedExpression = replacingVisitor.Visit(entityProjection.BindProperty(property));
resultValueBufferExpressions.Add(replacedExpression);
readExpressionMap[property] = CreateReadValueExpression(replacedExpression.Type, index++, property);
}
projectionMapping[projection.Key.Prepend(innerMemberInfo)]
= new EntityProjectionExpression(entityProjection.EntityType, readExpressionMap);
Expand Down Expand Up @@ -683,8 +685,9 @@ public virtual void AddSelectMany(InMemoryQueryExpression innerQueryExpression,
var readExpressionMap = new Dictionary<IProperty, Expression>();
foreach (var property in GetAllPropertiesInHierarchy(entityProjection.EntityType))
{
resultValueBufferExpressions.Add(replacingVisitor.Visit(entityProjection.BindProperty(property)));
readExpressionMap[property] = CreateReadValueExpression(property.ClrType, index++, property);
var replacedExpression = replacingVisitor.Visit(entityProjection.BindProperty(property));
resultValueBufferExpressions.Add(replacedExpression);
readExpressionMap[property] = CreateReadValueExpression(replacedExpression.Type, index++, property);
}
projectionMapping[projection.Key.Prepend(outerMemberInfo)]
= new EntityProjectionExpression(entityProjection.EntityType, readExpressionMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ public override Task SelectMany_nested_navigation_property_required(bool isAsync
return base.SelectMany_nested_navigation_property_required(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Join_flattening_bug_4539(bool isAsync)
{
return base.Join_flattening_bug_4539(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Include18_3_3(bool isAsync)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ public override Task Complex_query_with_optional_navigations_and_client_side_eva
return base.Complex_query_with_optional_navigations_and_client_side_evaluation(isAsync);
}

[ConditionalTheory(Skip = "Issue#16963 Too Many Results")]
public override Task Complex_navigations_with_predicate_projected_into_anonymous_type(bool isAsync)
{
return base.Complex_navigations_with_predicate_projected_into_anonymous_type(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 TooManyResults")]
public override Task SelectMany_with_nested_navigations_and_explicit_DefaultIfEmpty_followed_by_Select_required_navigation_using_different_navs(bool isAsync)
{
Expand Down Expand Up @@ -84,36 +78,12 @@ public override Task Join_with_navigations_in_the_result_selector1(bool isAsync)
return base.Join_with_navigations_in_the_result_selector1(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Include10(bool isAsync)
{
return base.Include10(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Include11(bool isAsync)
{
return base.Include11(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Include18_3_3(bool isAsync)
{
return base.Include18_3_3(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Multiple_include_with_multiple_optional_navigations(bool isAsync)
{
return base.Multiple_include_with_multiple_optional_navigations(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Order_by_key_of_anonymous_type_projected_navigation_doesnt_get_optimized_into_FK_access_subquery(bool isAsync)
{
return base.Order_by_key_of_anonymous_type_projected_navigation_doesnt_get_optimized_into_FK_access_subquery(isAsync);
}

[ConditionalTheory(Skip = "issue #16963 Test")]
public override Task Where_nav_prop_reference_optional1_via_DefaultIfEmpty(bool isAsync)
{
Expand Down