Skip to content

Commit

Permalink
Add regression test for issue#17555
Browse files Browse the repository at this point in the history
Resolves #17555
  • Loading branch information
smitpatel committed Sep 8, 2019
1 parent 0106878 commit f329ccd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1433,5 +1433,11 @@ public override async Task Cast_to_same_Type_Count_works(bool isAsync)
FROM root c
WHERE (c[""Discriminator""] = ""Customer"")");
}

[ConditionalTheory(Skip = "Issue#17246")]
public override Task DefaultIfEmpty_selects_only_required_columns(bool isAsync)
{
return base.DefaultIfEmpty_selects_only_required_columns(isAsync);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1793,5 +1793,14 @@ public virtual Task Enumerable_min_is_mapped_to_Queryable_2(bool isAsync)
isAsync,
cs => cs.Select(c => c.Orders.Select(o => (double?)o.OrderID).Min()));
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task DefaultIfEmpty_selects_only_required_columns(bool isAsync)
{
return AssertQuery<Product>(
isAsync,
ps => ps.Select(p => new { p.ProductID, p.ProductName }).DefaultIfEmpty().Select(p => p.ProductName));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1370,5 +1370,17 @@ FROM [Orders] AS [o]
WHERE ([c].[CustomerID] = [o].[CustomerID]) AND [o].[CustomerID] IS NOT NULL)
FROM [Customers] AS [c]");
}

public override async Task DefaultIfEmpty_selects_only_required_columns(bool isAsync)
{
await base.DefaultIfEmpty_selects_only_required_columns(isAsync);

AssertSql(
@"SELECT [p].[ProductName]
FROM (
SELECT NULL AS [empty]
) AS [empty]
LEFT JOIN [Products] AS [p] ON 1 = 1");
}
}
}

0 comments on commit f329ccd

Please sign in to comment.