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

Select_optional_navigation_property_string_concat throws #17229

Closed
ajcvickers opened this issue Aug 17, 2019 · 0 comments
Closed

Select_optional_navigation_property_string_concat throws #17229

ajcvickers opened this issue Aug 17, 2019 · 0 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@ajcvickers
Copy link
Contributor

Not sure if this failure is tracked somewhere else or not:

Microsoft.EntityFrameworkCore.Query.ComplexNavigationsQuerySqlServerTest.Select_optional_navigation_property_string_concat(isAsync: False)

System.NullReferenceException : Object reference not set to an instance of an object.
   at Microsoft.EntityFrameworkCore.Internal.EFPropertyExtensions.CreateEFPropertyExpression(Expression target, Type propertyDeclaringType, Type propertyType, String propertyName, Boolean makeNullable) in C:\aspnet\EntityFrameworkCore\src\EFCore\Extensions\Internal\EFPropertyExtensions.cs:line 101
   at Microsoft.EntityFrameworkCore.Internal.EFPropertyExtensions.CreateEFPropertyExpression(Expression target, IPropertyBase property, Boolean makeNullable) in C:\aspnet\EntityFrameworkCore\src\EFCore\Extensions\Internal\EFPropertyExtensions.cs:line 80
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.CreatePropertyAccessExpression(Expression target, IProperty property) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 943
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.RewriteNullEquality(Boolean equality, IEntityType entityType, Expression nonNullExpression, INavigation lastNavigation) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 807
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.RewriteNullEquality(Boolean equality, IEntityType entityType, Expression nonNullExpression, INavigation lastNavigation) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 794
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.RewriteEquality(Boolean equality, Expression left, Expression right) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 760
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.VisitBinary(BinaryExpression binaryExpression) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 141
   at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.VisitConditional(ConditionalExpression conditionalExpression) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 190
   at System.Linq.Expressions.ConditionalExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.VisitBinary(BinaryExpression binaryExpression) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 138
   at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.RewriteAndVisitLambda(LambdaExpression lambda, EntityReferenceExpression source1, EntityReferenceExpression source2) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 712
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.VisitSelectMethodCall(MethodCallExpression methodCallExpression) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 558
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 260
   at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityEqualityRewritingExpressionVisitor.Rewrite(Expression expression) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityEqualityRewritingExpressionVisitor.cs:line 50
   at Microsoft.EntityFrameworkCore.Query.QueryTranslationPreprocessor.Process(Expression query) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\QueryTranslationPreprocessor.cs:line 32
   at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\QueryCompilationContext.cs:line 66
   at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async) in C:\aspnet\EntityFrameworkCore\src\EFCore\Storage\Database.cs:line 71
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\QueryCompiler.cs:line 106
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.<Execute>b__0() in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\QueryCompiler.cs:line 96
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func`1 compiler) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\CompiledQueryCache.cs:line 84
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\CompiledQueryCache.cs:line 59
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\QueryCompiler.cs:line 92
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression) in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityQueryProvider.cs:line 79
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetEnumerator() in C:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\EntityQueryable`.cs:line 94
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.TestUtilities.QueryAsserter`1.AssertQuery[TItem1](Func`2 actualQuery, Func`2 expectedQuery, Func`2 elementSorter, Action`2 elementAsserter, Boolean assertOrder, Int32 entryCount, Boolean isAsync, String testMethodName) in C:\aspnet\EntityFrameworkCore\test\EFCore.Specification.Tests\TestUtilities\QueryAsserter.cs:line 349
   at Microsoft.EntityFrameworkCore.Query.ComplexNavigationsQuerySqlServerTest.Select_optional_navigation_property_string_concat(Boolean isAsync) in C:\aspnet\EntityFrameworkCore\test\EFCore.SqlServer.FunctionalTests\Query\ComplexNavigationsQuerySqlServerTest.cs:line 3510
--- End of stack trace from previous location where exception was thrown ---
@ajcvickers ajcvickers added this to the Backlog milestone Aug 19, 2019
@roji roji modified the milestones: Backlog, 3.1.0 Aug 23, 2019
roji added a commit that referenced this issue Aug 27, 2019
We now flow the last navigation only for pure traversal (via member,
EF.Property) and not for Select and others. This corrects valid
entity references which were misidentified as collection navigations.

Fixes #17229
roji added a commit that referenced this issue Aug 27, 2019
We now flow the last navigation only for pure traversal (via member,
EF.Property) and not for Select and others. This corrects valid
entity references which were misidentified as collection navigations.

Fixes #17229
roji added a commit that referenced this issue Aug 27, 2019
We now flow the last navigation only for pure traversal (via member,
EF.Property) and not for Select and others. This corrects valid
entity references which were misidentified as collection navigations.

Fixes #17229
@roji roji added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 27, 2019
@roji roji closed this as completed Aug 27, 2019
@ajcvickers ajcvickers modified the milestones: 3.1.0, 3.1.0-preview1 Oct 15, 2019
@ajcvickers ajcvickers modified the milestones: 3.1.0-preview1, 3.1.0 Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

2 participants