You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECTMIN("o"."HourlyRate") AS"HourlyRate",
MIN("c"."Id") AS"CustomerId",
MIN("c0"."Name") AS"CustomerName"FROM"TimeSheet"AS"t"LEFT JOIN"Order"AS"o"ON"t"."OrderId"="o"."Id"INNER JOIN"Project"AS"p"ON"t"."ProjectId"="p"."Id"INNER JOIN"Customer"AS"c"ON"p"."CustomerId"="c"."Id"INNER JOIN"Project"AS"p0"ON"t"."ProjectId"="p"."Id"-- <== THIS SHOULD BE ... = "p0"."Id"INNER JOIN"Customer"AS"c0"ON"p0"."CustomerId"="c"."Id"-- <== THIS SHOULD BE ... = "c0"."Id"WHERE"t"."OrderId"IS NOT NULLGROUP BY"t"."OrderId"
The generated ON clause for "p0" and "c0" produces a cartesian product.
git clone https://github.com/fschick/EF.GeneratedSelectBug.git
cd EF.GeneratedSelectBug
dotnet test
Provider and version information
EF Core version: 6.0.1
Database provider: at least Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.Sqlite
Target framework: .NET 6.0
Operating system: All
IDE: All
The text was updated successfully, but these errors were encountered:
…up by aggregate subquery
When replacing columns, we used the outer select expression which had additional joins from previous term whose aliases match tables in current join and it got updated with wrong table.
The fix is to utilize the original tables when replacing columns. These column replacement is to map the columns from initial tables of group by from subquery to outer group by query.
Resolves#27083
…up by aggregate subquery
When replacing columns, we used the outer select expression which had additional joins from previous term whose aliases match tables in current join and it got updated with wrong table.
The fix is to utilize the original tables when replacing columns. These column replacement is to map the columns from initial tables of group by from subquery to outer group by query.
Resolves#27083
…up by aggregate subquery
When replacing columns, we used the outer select expression which had additional joins from previous term whose aliases match tables in current join and it got updated with wrong table.
The fix is to utilize the original tables when replacing columns. These column replacement is to map the columns from initial tables of group by from subquery to outer group by query.
Resolves#27083
Generated JOIN for multiple MIN is wrong
When multiple
MIN
are used, the translatedON
clause of subsequent JOINs is wrongThe following query:
Is translated to:
The generated
ON
clause for"p0"
and"c0"
produces a cartesian product.See WhenGroupWithMinIsUsed_CustomerIdAndTitleMatches to reproduce
Code to reproduce
Provider and version information
EF Core version: 6.0.1
Database provider: at least Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.Sqlite
Target framework: .NET 6.0
Operating system: All
IDE: All
The text was updated successfully, but these errors were encountered: