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: Reading value from server may need to apply default #16575

Closed
smitpatel opened this issue Jul 11, 2019 · 2 comments
Closed

InMemory: Reading value from server may need to apply default #16575

smitpatel opened this issue Jul 11, 2019 · 2 comments
Assignees

Comments

@smitpatel
Copy link
Contributor

IQueryable<int> Select(
|__ source: DbSet<Customer>, 
|__ selector: (Customer Param_0) => (int)Nullable<int> FirstOrDefault(IQueryable<Nullable<int>> Select(
    |__ source: IQueryable<string> Distinct(IQueryable<string> Select(
    |   |__ source: IOrderedQueryable<Order> OrderBy(
    |   |   |__ source: IQueryable<Order> Where(
    |   |   |   |__ source: DbSet<Order>, 
    |   |   |   |__ predicate: (Order o) =>  ?= Property(Param_0, "CustomerID") == Property(o, "CustomerID") =? ), 
    |   |   |__ keySelector: (Order Param_0) => Param_0.OrderID), 
    |   |__ selector: (Order Param_0) => Param_0.CustomerID)), 
    |__ selector: (string Param_0) => (Nullable<int>)Param_0.Length)))

Above pass for relational since while reading the value we try to read int value from null column giving us back default which is 0. It fails for in memory because we read null and try to cast to int.

@ajcvickers ajcvickers added this to the 3.0.0 milestone Jul 12, 2019
@ajcvickers ajcvickers self-assigned this Jul 12, 2019
@roji
Copy link
Member

roji commented Jul 29, 2019

Simplified repro:

using (var context = CreateContext())
{
    var x = context.Customers
        .Select(c => context.Orders
            .Where(o => o == local)
            .Select(o => o.CustomerID)
            .FirstOrDefault().Length)
        .ToList();
}

@ajcvickers
Copy link
Member

Closed in favor of #16963

@ajcvickers ajcvickers removed this from the 3.0.0 milestone Aug 9, 2019
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
@ajcvickers ajcvickers removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants