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

Query: Where clause on optional reference navigation throws exception #6782

Closed
smitpatel opened this issue Oct 14, 2016 · 1 comment
Closed
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

@smitpatel
Copy link
Contributor

See test Where_predicate_on_optional_reference_navigation() in ComplexNavigationsQueryTestBase
Error is coming somewhere in QuerySourceUpdater
Exception:

------ Test started: Assembly: Microsoft.EntityFrameworkCore.SqlServer.FunctionalTests.dll ------

Test 'Microsoft.EntityFrameworkCore.SqlServer.FunctionalTests.ComplexNavigationsQuerySqlServerTest.Bug' failed: System.ArgumentException : Expression of type 'Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal.ValueBufferShaper' cannot be used for parameter of type 'Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal.IShaper`1[Microsoft.EntityFrameworkCore.Specification.Tests.TestModels.ComplexNavigationsModel.Level2]' of method 'System.Collections.Generic.IEnumerable`1[Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor+TransparentIdentifier`2[Microsoft.EntityFrameworkCore.Storage.ValueBuffer,System.Collections.Generic.IEnumerable`1[Microsoft.EntityFrameworkCore.Specification.Tests.TestModels.ComplexNavigationsModel.Level2]]] _GroupJoin[ValueBuffer,Level2,Int32,TransparentIdentifier`2](Microsoft.EntityFrameworkCore.Query.RelationalQueryContext, System.Collections.Generic.IEnumerable`1[Microsoft.EntityFrameworkCore.Storage.ValueBuffer], Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal.IShaper`1[Microsoft.EntityFrameworkCore.Storage.ValueBuffer], Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal.IShaper`1[Microsoft.EntityFrameworkCore.Specification.Tests.TestModels.ComplexNavigationsModel.Level2], System.Func`2[Microsoft.EntityFrameworkCore.Specification.Tests.TestModels.ComplexNavigationsModel.Level2,System.Int32], System.Func`3[Microsoft.EntityFrameworkCore.Storage.ValueBuffer,System.Collections.Generic.IEnumerable`1[Microsoft.EntityFrameworkCore.Specification.Tests.TestModels.ComplexNavigationsModel.Level2],Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor+TransparentIdentifier`2[Microsoft.EntityFrameworkCore.Storage.ValueBuffer,System.Collections.Generic.IEnumerable`1[Microsoft.EntityFrameworkCore.Specification.Tests.TestModels.ComplexNavigationsModel.Level2]]], Microsoft.EntityFrameworkCore.Query.Internal.GroupJoinInclude, Microsoft.EntityFrameworkCore.Query.Internal.GroupJoinInclude)'
    at System.Linq.Expressions.Expression.ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arg, ParameterInfo pi)
    at System.Linq.Expressions.Expression.ValidateArgumentTypes(MethodBase method, ExpressionType nodeKind, ReadOnlyCollection`1& arguments)
    at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method, IEnumerable`1 arguments)
    at System.Linq.Expressions.MethodCallExpressionN.Rewrite(Expression instance, IList`1 args)
    at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression node)
    Query\RelationalQueryModelVisitor.cs(1033,0): at Microsoft.EntityFrameworkCore.Query.RelationalQueryModelVisitor.QuerySourceUpdater.VisitMethodCall(MethodCallExpression methodCallExpression)
    at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
    at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
    Query\ExpressionVisitors\ExpressionVisitorBase.cs(26,0): at Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.ExpressionVisitorBase.Visit(Expression node)
    at System.Linq.Expressions.ExpressionVisitor.VisitAndConvert[T](ReadOnlyCollection`1 nodes, String callerName)
    Query\RelationalQueryModelVisitor.cs(1012,0): at Microsoft.EntityFrameworkCore.Query.RelationalQueryModelVisitor.QuerySourceUpdater.VisitMethodCall(MethodCallExpression methodCallExpression)
    at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
    at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
    Query\ExpressionVisitors\ExpressionVisitorBase.cs(26,0): at Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.ExpressionVisitorBase.Visit(Expression node)
    Query\RelationalQueryModelVisitor.cs(949,0): at Microsoft.EntityFrameworkCore.Query.RelationalQueryModelVisitor.LiftSubQuery(IQuerySource querySource, Expression itemsExpression, Expression expression)
    Query\RelationalQueryModelVisitor.cs(411,0): at Microsoft.EntityFrameworkCore.Query.RelationalQueryModelVisitor.CompileMainFromClauseExpression(MainFromClause mainFromClause, QueryModel queryModel)
    Query\EntityQueryModelVisitor.cs(740,0): at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.VisitMainFromClause(MainFromClause fromClause, QueryModel queryModel)
    at Remotion.Linq.Clauses.MainFromClause.Accept(IQueryModelVisitor visitor, QueryModel queryModel)
    at Remotion.Linq.QueryModelVisitorBase.VisitQueryModel(QueryModel queryModel)
    Query\EntityQueryModelVisitor.cs(721,0): at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.VisitQueryModel(QueryModel queryModel)
    Query\RelationalQueryModelVisitor.cs(373,0): at Microsoft.EntityFrameworkCore.Query.RelationalQueryModelVisitor.VisitQueryModel(QueryModel queryModel)
    Query\Internal\SqlServerQueryModelVisitor.cs(92,0): at Microsoft.EntityFrameworkCore.Query.Internal.SqlServerQueryModelVisitor.VisitQueryModel(QueryModel queryModel)
    Query\EntityQueryModelVisitor.cs(259,0): at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.CreateQueryExecutor[TResult](QueryModel queryModel)
    Storage\Database.cs(67,0): at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](QueryModel queryModel)
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    Query\Internal\QueryCompiler.cs(213,0): at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass19_0`1.<CompileQuery>b__0()
    Query\Internal\CompiledQueryCache.cs(68,0): at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func`1 compiler)
    Query\Internal\CompiledQueryCache.cs(45,0): at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
    Query\Internal\QueryCompiler.cs(168,0): at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQuery[TResult](Expression query)
    Query\Internal\QueryCompiler.cs(98,0): at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
    Query\Internal\EntityQueryProvider.cs(57,0): at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
    at Remotion.Linq.QueryableBase`1.GetEnumerator()
    at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
    ComplexNavigationsQueryTestBase.cs(3716,0): at Microsoft.EntityFrameworkCore.Specification.Tests.ComplexNavigationsQueryTestBase`2.Bug()
    ComplexNavigationsQuerySqlServerTest.cs(1901,0): at Microsoft.EntityFrameworkCore.SqlServer.FunctionalTests.ComplexNavigationsQuerySqlServerTest.Bug()

0 passed, 1 failed, 0 skipped, took 3.69 seconds (xUnit.net 2.2.0 build 3402).
@rowanmiller rowanmiller added this to the 1.2.0 milestone Oct 17, 2016
tuespetre added a commit to tuespetre/EntityFramework that referenced this issue Feb 4, 2017
tuespetre added a commit to tuespetre/EntityFramework that referenced this issue Feb 6, 2017
…ated

SQL

- Resolves dotnet#2341
- Resolves dotnet#5085
- Resolves dotnet#5230
- Resolves dotnet#6618
- Resolves dotnet#6647
- Resolves dotnet#6782
- Resolves dotnet#7080
- Resolves dotnet#7220
- Resolves dotnet#7417
- Resolves dotnet#7497
- Resolves dotnet#7523
- Resolves dotnet#7525
tuespetre added a commit to tuespetre/EntityFramework that referenced this issue Feb 6, 2017
…ated

SQL

- Resolves dotnet#2341
- Resolves dotnet#5085
- Resolves dotnet#5230
- Resolves dotnet#6618
- Resolves dotnet#6647
- Resolves dotnet#6782
- Resolves dotnet#7080
- Resolves dotnet#7220
- Resolves dotnet#7417
- Resolves dotnet#7497
- Resolves dotnet#7523
- Resolves dotnet#7525
tuespetre added a commit to tuespetre/EntityFramework that referenced this issue Feb 6, 2017
…ated

SQL

- Resolves dotnet#2341
- Resolves dotnet#5085
- Resolves dotnet#6618
- Resolves dotnet#6647
- Resolves dotnet#6782
- Resolves dotnet#7080
- Resolves dotnet#7220
- Resolves dotnet#7417
- Resolves dotnet#7497
- Resolves dotnet#7523
- Resolves dotnet#7525
tuespetre added a commit to tuespetre/EntityFramework that referenced this issue Feb 6, 2017
…ated

SQL

- Resolves dotnet#2341
- Resolves dotnet#5085
- Resolves dotnet#6618
- Resolves dotnet#6647
- Resolves dotnet#6782
- Resolves dotnet#7080
- Resolves dotnet#7220
- Resolves dotnet#7417
- Resolves dotnet#7497
- Resolves dotnet#7523
- Resolves dotnet#7525
tuespetre added a commit to tuespetre/EntityFramework that referenced this issue Feb 7, 2017
…ated

SQL

- Resolves dotnet#2341
- Resolves dotnet#5085
- Resolves dotnet#6618
- Resolves dotnet#6647
- Resolves dotnet#6782
- Resolves dotnet#7080
- Resolves dotnet#7220
- Resolves dotnet#7417
- Resolves dotnet#7497
- Resolves dotnet#7523
- Resolves dotnet#7525
tuespetre added a commit to tuespetre/EntityFramework that referenced this issue Feb 9, 2017
…ated

SQL

- Resolves dotnet#2341
- Resolves dotnet#5085
- Resolves dotnet#6618
- Resolves dotnet#6647
- Resolves dotnet#6782
- Resolves dotnet#7080
- Resolves dotnet#7220
- Resolves dotnet#7417
- Resolves dotnet#7497
- Resolves dotnet#7523
- Resolves dotnet#7525
@maumar
Copy link
Contributor

maumar commented Apr 5, 2017

fixed in f868cdc

@maumar maumar closed this as completed Apr 5, 2017
@maumar maumar added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 5, 2017
@divega divega added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. labels May 10, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Oct 15, 2022
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

5 participants