-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Must be reductible node #11933
Comments
Just to get more data, would it be possible to test with 2.1.0-preview2-final for all packages (both Microsoft and Npgsql)? This would tell us whether is coming from mixing 2.0 and 2.1 (Npgsql's rc1 packages aren't out yet, but that should happen very soon) |
sure one moment |
Same issue in:
|
Note I did not updated Npgsql |
@NicolasDorier as I wrote above the idea is to align both Microsoft and Npgsql versions... Can you please try with all packages on 2.1.0-preview2, both Microsoft and Npgsql? |
Ah sorry, I missed the preview package for Postgres as they were not listed by the nuget UI, trying now. |
Both |
I received this error frequently with certain queries as well, using sqlserver and 2.1 preview 2. @NicolasDorier Thanks for giving a full repo for this issue. |
@maumar Can you investigate this with regard to it being a regression in 2.1? |
@ajcvickers verified this is a regression - the code was working fine in 2.0.2 |
query plan (with non-reducible nodes highlighted):
|
query plan in 2.0.2 - SelectMany gets translated, in current bits it gets client-evaled
|
@maumar Do you need @anpete or @smitpatel to help on this? |
@ajcvickers the regression comes from nav rewrite, so I'm the right person to work on it. |
simplified repro: class Program
{
static void Main(string[] args)
{
using (var ctx = new MyContext())
{
ctx.Database.EnsureDeleted();
ctx.Database.EnsureCreated();
}
using (var ctx = new MyContext())
{
var query = ctx.Customers.SelectMany(c => c.Orders.Select(o => new { OrderName = o.Name, CustomerName = c.Name }));
var result = query.ToList();
}
}
}
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public List<Order> Orders { get; set; }
}
public class Order
{
public int Id { get; set; }
public string Name { get; set; }
}
public class MyContext : DbContext
{
public DbSet<Customer> Customers { get; set; }
public DbSet<Order> Orders { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(@"Server=.;Database=Repro11933;Trusted_Connection=True;MultipleActiveResultSets=True");
}
} |
Error happens because we changed translation of SelectMany for non-qsre subqueries - #11219 Now we translate those into subqueries, rather than joins. This however exposes the binding issue, when the subquery has references to the outer query sources. Given that this query used to work in 2.0.2 the fix to #11219 was incorrect (or at least too aggressive). |
This is a big blocker for us and we've been waiting for EF Core 3.0. Is it not going to be fixed in 3.0 anymore? |
Can we verify this is fixed? |
@btecu Yes. You can use the daily builds to do your verification. |
verified this issue has been fixed in 3.0 |
@maumar - Regression test. |
@smitpatel i have test ready, will send PR with regressions for multiple issues |
@ajcvickers I tested preview 9 and confirm that previous query that in 2.x was broken now works. |
Describe what is not working as expected.
I am migrating to .NET 2.1, but it seems entity framework broke:
This was working in 2.0:
Now it throws
Note that if I comment
it does not crash.
Workaround:
The text was updated successfully, but these errors were encountered: