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

ArgumentOutOfRangeException for split query with owned types #23211

Closed
AndriySvyryd opened this issue Nov 6, 2020 · 3 comments
Closed

ArgumentOutOfRangeException for split query with owned types #23211

AndriySvyryd opened this issue Nov 6, 2020 · 3 comments
Assignees
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. Servicing-approved type-bug
Milestone

Comments

@AndriySvyryd
Copy link
Member

Query:

context.Set<Root>()
    .AsSplitQuery()
    .Include(e => e.OptionalChildren)
    .OrderBy(e => e.Id)
    .Single(r => r.AlternateId == Fixture.RootAK);

Root.RequiredSingle and Root.RequiredSingleAk are owned.

System.ArgumentOutOfRangeException : Index was out of range. Must be non-negative and less than the size of the
List1.get_Item(Int32 index) SelectExpression.ApplyCollectionJoin(Int32 collectionIndex, Int32 collectionId, Expression innerShaper, INavigationBase navigation, Type elementType, Boolean splitQuery) line 1480 CollectionJoinApplyingExpressionVisitor.VisitExtension(Expression extensionExpression) line 76 IncludeExpression.VisitChildren(ExpressionVisitor visitor) line 74 CollectionJoinApplyingExpressionVisitor.VisitExtension(Expression extensionExpression) line 97 IncludeExpression.VisitChildren(ExpressionVisitor visitor) line 73 CollectionJoinApplyingExpressionVisitor.VisitExtension(Expression extensionExpression) line 97 IncludeExpression.VisitChildren(ExpressionVisitor visitor) line 73 CollectionJoinApplyingExpressionVisitor.VisitExtension(Expression extensionExpression) line 97 IncludeExpression.VisitChildren(ExpressionVisitor visitor) line 73 CollectionJoinApplyingExpressionVisitor.VisitExtension(Expression extensionExpression) line 97 CollectionJoinApplyingExpressionVisitor.VisitExtension(Expression extensionExpression) line 97 RelationalQueryTranslationPostprocessor.Process(Expression query) line 45 QueryCompilationContext.CreateQueryExecutor[TResult](Expression query) line 177 Database.CompileQuery[TResult](Expression query, Boolean async) line 72 QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async) line 114 <>c__DisplayClass9_01.b__0() line 98
CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func1 compiler) line 78 QueryCompiler.Execute[TResult](Expression query) line 94 EntityQueryProvider.Execute[TResult](Expression expression) line 81 GraphUpdatesTestBase1.LoadOptionalGraph(DbContext context) line 649

@smitpatel
Copy link
Member

Are owned objects mapped to different tables?

@AndriySvyryd
Copy link
Member Author

Root.RequiredSingle is table-splitting
Root.RequiredSingleAk is mapped to a different table

@ajcvickers ajcvickers modified the milestones: 6.0.0, 5.0.x Nov 6, 2020
AndriySvyryd added a commit that referenced this issue Nov 10, 2020
Disable owned entity reparenting if it leads to key modification
Fix default SQL Server value generation strategy for shared columns
Query: Detect parent identifier correctly when parent has owned navs

Fixes #16454
Part of #23211
AndriySvyryd added a commit that referenced this issue Nov 11, 2020
Disable owned entity reparenting if it leads to key modification
Fix default SQL Server value generation strategy for shared columns
Query: Detect parent identifier correctly when parent has owned navs

Fixes #16454
Part of #23211
@ajcvickers
Copy link
Member

@smitpatel What's the servicing-consider status of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. Servicing-approved type-bug
Projects
None yet
Development

No branches or pull requests

3 participants