diff --git a/src/EFCore.Relational/Query/SqlExpressions/SelectExpression.cs b/src/EFCore.Relational/Query/SqlExpressions/SelectExpression.cs index 2efcd67ecf8..05513c64c68 100644 --- a/src/EFCore.Relational/Query/SqlExpressions/SelectExpression.cs +++ b/src/EFCore.Relational/Query/SqlExpressions/SelectExpression.cs @@ -896,7 +896,11 @@ static void UpdateLimit(SelectExpression selectExpression) innerShaperExpression); } - AddJoin(JoinType.OuterApply, ref innerSelectExpression, out _); + // Single-result (to-one) joins never increase result cardinality, so the outer entity's + // identifiers are already sufficient to uniquely identify rows. We don't need to add the + // inner's identifiers to our own; doing so would cause unnecessary reference table JOINs, + // ORDER BY columns, and projections in split collection queries (#29182). + AddJoin(JoinType.OuterApply, ref innerSelectExpression, out _, isToOneJoin: true); var offset = _clientProjections.Count; var count = innerSelectExpression._clientProjections.Count; @@ -3018,7 +3022,8 @@ private void AddJoin( JoinType joinType, ref SelectExpression innerSelect, out bool innerPushdownOccurred, - SqlExpression? joinPredicate = null) + SqlExpression? joinPredicate = null, + bool isToOneJoin = false) { innerPushdownOccurred = false; // Try to convert Apply to normal join @@ -3099,7 +3104,8 @@ private void AddJoin( joinType == JoinType.CrossApply ? JoinType.InnerJoin : JoinType.LeftJoin, ref innerSelect, out innerPushdownOccurred, - joinPredicate); + joinPredicate, + isToOneJoin); return; } @@ -3153,24 +3159,37 @@ private void AddJoin( innerPushdownOccurred = true; } + // If the caller knows this is a to-one join (e.g. SingleResult in ApplyProjection), or if the + // join predicate equates all of the inner's identifier columns (PK) to outer columns, then the + // join doesn't increase cardinality — the outer identifiers are already sufficient. Skipping the + // inner's identifiers avoids unnecessary JOINs, ORDER BY columns, and projections in split + // collection queries (#29182). + if (!isToOneJoin && joinPredicate is not null && innerSelect._identifier.Count > 0) + { + isToOneJoin = AllInnerIdentifiersInPredicate(joinPredicate, innerSelect._identifier); + } + if (_identifier.Count > 0 && innerSelect._identifier.Count > 0) { - switch (joinType) + if (!isToOneJoin) { - case JoinType.LeftJoin or JoinType.OuterApply: - _identifier.AddRange(innerSelect._identifier.Select(e => (e.Column.MakeNullable(), e.Comparer))); - break; + switch (joinType) + { + case JoinType.LeftJoin or JoinType.OuterApply: + _identifier.AddRange(innerSelect._identifier.Select(e => (e.Column.MakeNullable(), e.Comparer))); + break; - case JoinType.RightJoin: - var nullableOuterIdentifier = _identifier.Select(e => (e.Column.MakeNullable(), e.Comparer)).ToList(); - _identifier.Clear(); - _identifier.AddRange(nullableOuterIdentifier); - _identifier.AddRange(innerSelect._identifier); - break; + case JoinType.RightJoin: + var nullableOuterIdentifier = _identifier.Select(e => (e.Column.MakeNullable(), e.Comparer)).ToList(); + _identifier.Clear(); + _identifier.AddRange(nullableOuterIdentifier); + _identifier.AddRange(innerSelect._identifier); + break; - default: - _identifier.AddRange(innerSelect._identifier); - break; + default: + _identifier.AddRange(innerSelect._identifier); + break; + } } } else @@ -3185,7 +3204,7 @@ private void AddJoin( var joinTable = joinType switch { JoinType.InnerJoin => new InnerJoinExpression(innerTable, joinPredicate!), - JoinType.LeftJoin => new LeftJoinExpression(innerTable, joinPredicate!), + JoinType.LeftJoin => new LeftJoinExpression(innerTable, joinPredicate!, prunable: isToOneJoin), JoinType.RightJoin => new RightJoinExpression(innerTable, joinPredicate!), JoinType.CrossJoin => new CrossJoinExpression(innerTable), JoinType.CrossApply => new CrossApplyExpression(innerTable), @@ -3219,6 +3238,57 @@ static void GetPartitions(SelectExpression select, SqlExpression sqlExpression, } } + // Checks whether all of the inner select's identifier columns appear as equality terms in the + // join predicate. If so, the join is to-one from the outer's perspective (each outer row matches + // at most one inner row), meaning the inner identifiers are redundant for row identification. + static bool AllInnerIdentifiersInPredicate( + SqlExpression joinPredicate, + List<(ColumnExpression Column, ValueComparer Comparer)> innerIdentifiers) + { + Span matched = innerIdentifiers.Count <= 8 + ? stackalloc bool[innerIdentifiers.Count] + : new bool[innerIdentifiers.Count]; + + MatchIdentifiersInPredicate(joinPredicate, innerIdentifiers, matched); + + foreach (var m in matched) + { + if (!m) + { + return false; + } + } + + return true; + + static void MatchIdentifiersInPredicate( + SqlExpression expression, + List<(ColumnExpression Column, ValueComparer Comparer)> identifiers, + Span matched) + { + switch (expression) + { + case SqlBinaryExpression { OperatorType: ExpressionType.Equal } binary: + for (var i = 0; i < identifiers.Count; i++) + { + if (!matched[i] + && (identifiers[i].Column.Equals(binary.Left) + || identifiers[i].Column.Equals(binary.Right))) + { + matched[i] = true; + } + } + + break; + + case SqlBinaryExpression { OperatorType: ExpressionType.AndAlso } binary: + MatchIdentifiersInPredicate(binary.Left, identifiers, matched); + MatchIdentifiersInPredicate(binary.Right, identifiers, matched); + break; + } + } + } + static SqlExpression? TryExtractJoinKey(SelectExpression outer, SelectExpression inner, bool allowNonEquality) { if (inner.Limit != null diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqlServerTest.cs index 79db8e7e787..0c170c72d99 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqlServerTest.cs @@ -165,7 +165,6 @@ public override async Task Delete_entity_with_auto_include(bool async) """ DELETE FROM [c] FROM [Context30572_Principal] AS [c] -LEFT JOIN [Context30572_Dependent] AS [c0] ON [c].[DependentId] = [c0].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs index 3c135a53aa8..99b97aa02aa 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs @@ -532,18 +532,8 @@ public override async Task Delete_with_LeftJoin(bool async) AssertSql( """ -@p='0' -@p1='100' - DELETE FROM [o] FROM [Order Details] AS [o] -LEFT JOIN ( - SELECT [o0].[OrderID] - FROM [Orders] AS [o0] - WHERE [o0].[OrderID] < 10300 - ORDER BY [o0].[OrderID] - OFFSET @p ROWS FETCH NEXT @p1 ROWS ONLY -) AS [o1] ON [o].[OrderID] = [o1].[OrderID] WHERE [o].[OrderID] < 10276 """); } @@ -554,18 +544,8 @@ public override async Task Delete_with_LeftJoin_via_flattened_GroupJoin(bool asy AssertSql( """ -@p='0' -@p1='100' - DELETE FROM [o] FROM [Order Details] AS [o] -LEFT JOIN ( - SELECT [o0].[OrderID] - FROM [Orders] AS [o0] - WHERE [o0].[OrderID] < 10300 - ORDER BY [o0].[OrderID] - OFFSET @p ROWS FETCH NEXT @p1 ROWS ONLY -) AS [o1] ON [o].[OrderID] = [o1].[OrderID] WHERE [o].[OrderID] < 10276 """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/ManyToManyFieldsLoadSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/ManyToManyFieldsLoadSqlServerTest.cs index 554b85a74d8..727a35e3dd1 100644 --- a/test/EFCore.SqlServer.FunctionalTests/ManyToManyFieldsLoadSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/ManyToManyFieldsLoadSqlServerTest.cs @@ -33,7 +33,7 @@ FROM [JoinOneToTwo] AS [j0] WHERE [e1].[Id] = @p ) AS [s0] ON [s].[Id] = [s0].[TwoId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s0].[OneId], [s0].[TwoId] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s0].[OneId] """); } @@ -59,7 +59,7 @@ FROM [EntityOneEntityTwo] AS [e2] WHERE [e3].[Id] = @p ) AS [s0] ON [s].[Id] = [s0].[TwoSkipSharedId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s0].[OneSkipSharedId] """); } @@ -90,7 +90,7 @@ FROM [EntityOneEntityTwo] AS [e4] WHERE [e3].[Id] = @p ) AS [s1] ON [s].[Id] = [s1].[TwoSkipSharedId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s1].[Id], [s1].[OneSkipSharedId0], [s1].[TwoSkipSharedId0] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s1].[OneSkipSharedId0] """); } @@ -121,7 +121,7 @@ FROM [JoinTwoToThree] AS [j] INNER JOIN [EntityThrees] AS [e4] ON [j].[ThreeId] = [e4].[Id] ) AS [s1] ON [s].[Id] = [s1].[TwoId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId], [s0].[Id], [s1].[ThreeId], [s1].[TwoId] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId], [s1].[ThreeId] """); } @@ -153,7 +153,7 @@ FROM [JoinTwoToThree] AS [j] WHERE [e4].[Id] IN (13, 11) ) AS [s1] ON [s].[Id] = [s1].[TwoId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId], [s0].[Id], [s1].[ThreeId], [s1].[TwoId] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId], [s1].[ThreeId] """); } @@ -193,7 +193,7 @@ public override async Task Load_collection_using_Query_with_join(bool async) """ @p='3' -SELECT [s].[Id], [s].[CollectionInverseId], [s].[Name], [s].[ReferenceInverseId], [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s1].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s1].[Id0], [s2].[OneSkipSharedId], [s2].[TwoSkipSharedId], [s2].[Id], [s2].[Name], [s1].[CollectionInverseId], [s1].[Name0], [s1].[ReferenceInverseId] +SELECT [s].[Id], [s].[CollectionInverseId], [s].[Name], [s].[ReferenceInverseId], [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s1].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s2].[OneSkipSharedId], [s2].[TwoSkipSharedId], [s2].[Id], [s2].[Name], [s1].[Id0], [s1].[CollectionInverseId], [s1].[Name0], [s1].[ReferenceInverseId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], [e0].[TwoSkipSharedId] @@ -216,7 +216,7 @@ FROM [EntityOneEntityTwo] AS [e5] WHERE [e6].[Id] = @p ) AS [s2] ON [s].[Id] = [s2].[TwoSkipSharedId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s1].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s1].[Id0], [s2].[OneSkipSharedId], [s2].[TwoSkipSharedId] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s1].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s2].[OneSkipSharedId] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/ManyToManyLoadSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/ManyToManyLoadSqlServerTest.cs index b124d84d20a..aea064c4804 100644 --- a/test/EFCore.SqlServer.FunctionalTests/ManyToManyLoadSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/ManyToManyLoadSqlServerTest.cs @@ -33,7 +33,7 @@ FROM [JoinOneToTwo] AS [j0] WHERE [e1].[Id] = @p ) AS [s0] ON [s].[Id] = [s0].[TwoId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s0].[OneId], [s0].[TwoId] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s0].[OneId] """ : """ @p='3' @@ -52,7 +52,7 @@ FROM [JoinOneToTwo] AS [j0] WHERE [e1].[Id] = @p ) AS [s0] ON [s].[Id] = [s0].[TwoId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s0].[OneId], [s0].[TwoId] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s0].[OneId] """); } @@ -78,7 +78,7 @@ FROM [EntityOneEntityTwo] AS [e2] WHERE [e3].[Id] = @p ) AS [s0] ON [s].[Id] = [s0].[TwoSkipSharedId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s0].[OneSkipSharedId] """); } @@ -109,7 +109,7 @@ FROM [EntityOneEntityTwo] AS [e4] WHERE [e3].[Id] = @p ) AS [s1] ON [s].[Id] = [s1].[TwoSkipSharedId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s1].[Id], [s1].[OneSkipSharedId0], [s1].[TwoSkipSharedId0] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s1].[OneSkipSharedId0] """); } @@ -140,7 +140,7 @@ FROM [JoinTwoToThree] AS [j] INNER JOIN [EntityThrees] AS [e4] ON [j].[ThreeId] = [e4].[Id] ) AS [s1] ON [s].[Id] = [s1].[TwoId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId], [s0].[Id], [s1].[ThreeId], [s1].[TwoId] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId], [s1].[ThreeId] """); } @@ -172,7 +172,7 @@ FROM [JoinTwoToThree] AS [j] WHERE [e4].[Id] IN (13, 11) ) AS [s1] ON [s].[Id] = [s1].[TwoId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId], [s0].[Id], [s1].[ThreeId], [s1].[TwoId] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s0].[OneSkipSharedId], [s0].[TwoSkipSharedId], [s1].[ThreeId] """); } @@ -212,7 +212,7 @@ public override async Task Load_collection_using_Query_with_join(bool async) """ @p='3' -SELECT [s].[Id], [s].[CollectionInverseId], [s].[ExtraId], [s].[Name], [s].[ReferenceInverseId], [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s1].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s1].[Id0], [s2].[OneSkipSharedId], [s2].[TwoSkipSharedId], [s2].[Id], [s2].[Name], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name0], [s1].[ReferenceInverseId] +SELECT [s].[Id], [s].[CollectionInverseId], [s].[ExtraId], [s].[Name], [s].[ReferenceInverseId], [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s1].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s2].[OneSkipSharedId], [s2].[TwoSkipSharedId], [s2].[Id], [s2].[Name], [s1].[Id0], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name0], [s1].[ReferenceInverseId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], [e0].[TwoSkipSharedId] @@ -235,7 +235,7 @@ FROM [EntityOneEntityTwo] AS [e5] WHERE [e6].[Id] = @p ) AS [s2] ON [s].[Id] = [s2].[TwoSkipSharedId] WHERE [e].[Id] = @p -ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s].[Id], [s1].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s1].[Id0], [s2].[OneSkipSharedId], [s2].[TwoSkipSharedId] +ORDER BY [e].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId], [s1].[Id], [s1].[OneSkipSharedId], [s1].[TwoSkipSharedId], [s2].[OneSkipSharedId] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/AdHocManyToManyQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/AdHocManyToManyQuerySqlServerTest.cs index 536d70fb0be..1abc3b916d0 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/AdHocManyToManyQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/AdHocManyToManyQuerySqlServerTest.cs @@ -67,7 +67,7 @@ FROM [ManyMN_DB] AS [m2] WHERE [m3].[Id] = @p ) AS [s0] ON [s].[Id] = [s0].[ManyN_Id] WHERE [m].[Id] = @p -ORDER BY [m].[Id], [s].[Id0], [s].[Id], [s0].[Id] +ORDER BY [m].[Id], [s].[Id0] """, // """ @@ -95,7 +95,7 @@ FROM [ManyMN_DB] AS [m2] WHERE [m3].[Id] = @p ) AS [s0] ON [s].[Id] = [s0].[ManyM_Id] WHERE [m].[Id] = @p -ORDER BY [m].[Id], [s].[Id0], [s].[Id], [s0].[Id] +ORDER BY [m].[Id], [s].[Id0] """); } } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/AdHocNavigationsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/AdHocNavigationsQuerySqlServerTest.cs index a1831786ee1..903502ad9ab 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/AdHocNavigationsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/AdHocNavigationsQuerySqlServerTest.cs @@ -210,7 +210,7 @@ FROM [People] AS [p0] WHERE [p0].[Discriminator] = N'PersonKid9038' ) AS [s] ON [p].[Id] = [s].[TeacherId] WHERE [p].[Discriminator] = N'PersonTeacher9038' -ORDER BY [p].[Id], [s].[Id], [s].[Id0] +ORDER BY [p].[Id], [s].[Id] """, // """ @@ -224,7 +224,7 @@ FROM [People] AS [p1] WHERE [p1].[Discriminator] = N'PersonKid9038' ) AS [p2] ON [p].[Id] = [p2].[TeacherId] WHERE [p].[Discriminator] = N'PersonTeacher9038' -ORDER BY [p].[Id], [f].[Id], [p0].[Id] +ORDER BY [p].[Id], [p0].[Id] """); } @@ -318,11 +318,11 @@ public override async Task Let_multiple_references_with_reference_to_outer() SELECT ( SELECT TOP(1) [c].[Id] FROM [CompetitionSeasons] AS [c] - WHERE [c].[StartDate] <= [a].[DateTime] AND [a].[DateTime] < [c].[EndDate]), [a].[Id], [a0].[Id], [s].[Id], [s].[ActivityTypeId], [s].[CompetitionSeasonId], [s].[Points], [s].[Id0] + WHERE [c].[StartDate] <= [a].[DateTime] AND [a].[DateTime] < [c].[EndDate]), [a].[Id], [s].[Id], [s].[ActivityTypeId], [s].[CompetitionSeasonId], [s].[Points] FROM [Activities] AS [a] INNER JOIN [ActivityType] AS [a0] ON [a].[ActivityTypeId] = [a0].[Id] OUTER APPLY ( - SELECT [a1].[Id], [a1].[ActivityTypeId], [a1].[CompetitionSeasonId], [a1].[Points], [c0].[Id] AS [Id0] + SELECT [a1].[Id], [a1].[ActivityTypeId], [a1].[CompetitionSeasonId], [a1].[Points] FROM [ActivityTypePoints] AS [a1] INNER JOIN [CompetitionSeasons] AS [c0] ON [a1].[CompetitionSeasonId] = [c0].[Id] WHERE [a0].[Id] = [a1].[ActivityTypeId] AND [c0].[Id] = ( @@ -330,7 +330,7 @@ SELECT TOP(1) [c1].[Id] FROM [CompetitionSeasons] AS [c1] WHERE [c1].[StartDate] <= [a].[DateTime] AND [a].[DateTime] < [c1].[EndDate]) ) AS [s] -ORDER BY [a].[Id], [a0].[Id], [s].[Id] +ORDER BY [a].[Id] """, // """ @@ -512,7 +512,7 @@ ORDER BY [p].[Id] FROM [DependentOneToMany] AS [d] INNER JOIN [PrincipalOneToMany] AS [p] ON [d].[PrincipalId] = [p].[Id] LEFT JOIN [DependentOneToMany] AS [d0] ON [p].[Id] = [d0].[PrincipalId] -ORDER BY [d].[Id], [p].[Id] +ORDER BY [d].[Id] """, // """ @@ -569,7 +569,7 @@ LEFT JOIN ( FROM [ManyDependent] AS [m0] LEFT JOIN [SingleDependent] AS [s] ON [m0].[Id] = [s].[ManyDependentId] ) AS [s0] ON [p].[Id] = [s0].[PrincipalId] -ORDER BY [m].[Id], [p].[Id], [s0].[Id] +ORDER BY [m].[Id], [s0].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionSqlServerTest.cs index 4d672656a85..89fc2fd761c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionSqlServerTest.cs @@ -12,7 +12,7 @@ public override async Task Count() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a0].[OptionalNestedAssociateId] = [n].[Id] @@ -21,7 +21,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a1].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a1].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a2] LEFT JOIN [NestedAssociateType] AS [n3] ON [a2].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a2].[RequiredNestedAssociateId] = [n4].[Id] @@ -33,7 +33,7 @@ FROM [AssociateType] AS [a2] SELECT COUNT(*) FROM [AssociateType] AS [a] WHERE [r].[Id] = [a].[CollectionRootId]) = 2 -ORDER BY [r].[Id], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -43,7 +43,7 @@ public override async Task Where() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a0].[OptionalNestedAssociateId] = [n].[Id] @@ -52,7 +52,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a1].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a1].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a2] LEFT JOIN [NestedAssociateType] AS [n3] ON [a2].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a2].[RequiredNestedAssociateId] = [n4].[Id] @@ -64,7 +64,7 @@ FROM [AssociateType] AS [a2] SELECT COUNT(*) FROM [AssociateType] AS [a] WHERE [r].[Id] = [a].[CollectionRootId] AND [a].[Int] <> 8) = 2 -ORDER BY [r].[Id], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -74,7 +74,7 @@ public override async Task OrderBy_ElementAt() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a0].[OptionalNestedAssociateId] = [n].[Id] @@ -83,7 +83,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a1].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a1].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a2] LEFT JOIN [NestedAssociateType] AS [n3] ON [a2].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a2].[RequiredNestedAssociateId] = [n4].[Id] @@ -97,7 +97,7 @@ FROM [AssociateType] AS [a] WHERE [r].[Id] = [a].[CollectionRootId] ORDER BY [a].[Id] OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY) = 8 -ORDER BY [r].[Id], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -109,7 +109,7 @@ public override async Task Distinct() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a1].[Id], [n].[Id], [n0].[Id], [a2].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a1] ON [r].[OptionalAssociateId] = [a1].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a1].[OptionalNestedAssociateId] = [n].[Id] @@ -118,7 +118,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a2].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a2].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a3].[Id], [a3].[CollectionRootId], [a3].[Int], [a3].[Ints], [a3].[Name], [a3].[OptionalNestedAssociateId], [a3].[RequiredNestedAssociateId], [a3].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a3].[Id], [a3].[CollectionRootId], [a3].[Int], [a3].[Ints], [a3].[Name], [a3].[OptionalNestedAssociateId], [a3].[RequiredNestedAssociateId], [a3].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a3] LEFT JOIN [NestedAssociateType] AS [n3] ON [a3].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a3].[RequiredNestedAssociateId] = [n4].[Id] @@ -133,7 +133,7 @@ SELECT COUNT(*) FROM [AssociateType] AS [a] WHERE [r].[Id] = [a].[CollectionRootId] ) AS [a0]) = 2 -ORDER BY [r].[Id], [a1].[Id], [n].[Id], [n0].[Id], [a2].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -143,10 +143,10 @@ public override async Task Distinct_projected(QueryTrackingBehavior queryTrackin AssertSql( """ -SELECT [r].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2] +SELECT [r].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2] FROM [RootEntity] AS [r] OUTER APPLY ( - SELECT [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n].[Id] AS [Id0], [n0].[Id] AS [Id1], [n1].[Id] AS [Id2], [n1].[CollectionAssociateId], [n1].[Int] AS [Int0], [n1].[Ints] AS [Ints0], [n1].[Name] AS [Name0], [n1].[String] AS [String0], [n].[CollectionAssociateId] AS [CollectionAssociateId0], [n].[Int] AS [Int1], [n].[Ints] AS [Ints1], [n].[Name] AS [Name1], [n].[String] AS [String1], [n0].[CollectionAssociateId] AS [CollectionAssociateId1], [n0].[Int] AS [Int2], [n0].[Ints] AS [Ints2], [n0].[Name] AS [Name2], [n0].[String] AS [String2] + SELECT [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n1].[Id] AS [Id0], [n1].[CollectionAssociateId], [n1].[Int] AS [Int0], [n1].[Ints] AS [Ints0], [n1].[Name] AS [Name0], [n1].[String] AS [String0], [n].[Id] AS [Id1], [n].[CollectionAssociateId] AS [CollectionAssociateId0], [n].[Int] AS [Int1], [n].[Ints] AS [Ints1], [n].[Name] AS [Name1], [n].[String] AS [String1], [n0].[Id] AS [Id2], [n0].[CollectionAssociateId] AS [CollectionAssociateId1], [n0].[Int] AS [Int2], [n0].[Ints] AS [Ints2], [n0].[Name] AS [Name2], [n0].[String] AS [String2] FROM ( SELECT DISTINCT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String] FROM [AssociateType] AS [a] @@ -156,7 +156,7 @@ FROM [AssociateType] AS [a] INNER JOIN [NestedAssociateType] AS [n0] ON [a0].[RequiredNestedAssociateId] = [n0].[Id] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[Id] = [n1].[CollectionAssociateId] ) AS [s] -ORDER BY [r].[Id], [s].[Id], [s].[Id0], [s].[Id1] +ORDER BY [r].[Id], [s].[Id] """); } @@ -224,7 +224,7 @@ public override async Task GroupBy() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a0].[OptionalNestedAssociateId] = [n].[Id] @@ -233,7 +233,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a1].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a1].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a2] LEFT JOIN [NestedAssociateType] AS [n3] ON [a2].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a2].[RequiredNestedAssociateId] = [n4].[Id] @@ -247,7 +247,7 @@ FROM [AssociateType] AS [a] WHERE [r].[Id] = [a].[CollectionRootId] GROUP BY [a].[String] ) -ORDER BY [r].[Id], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsIncludeSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsIncludeSqlServerTest.cs index 4242bedaacc..6c165d5bafb 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsIncludeSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsIncludeSqlServerTest.cs @@ -12,7 +12,7 @@ public override async Task Include_required(bool async) AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -21,7 +21,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -29,7 +29,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -39,7 +39,7 @@ public override async Task Include_optional(bool async) AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -48,7 +48,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -56,7 +56,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -66,7 +66,7 @@ public override async Task Include_collection(bool async) AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -75,7 +75,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -83,7 +83,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -93,7 +93,7 @@ public override async Task Include_required_optional_and_collection(bool async) AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -102,7 +102,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -110,7 +110,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -120,7 +120,7 @@ public override async Task Include_nested(bool async) AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -129,7 +129,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -137,7 +137,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -147,7 +147,7 @@ public override async Task Include_nested_optional(bool async) AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -156,7 +156,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -164,7 +164,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -174,7 +174,7 @@ public override async Task Include_nested_collection(bool async) AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -183,7 +183,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -191,7 +191,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -201,7 +201,7 @@ public override async Task Include_nested_collection_on_optional(bool async) AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -210,7 +210,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -218,7 +218,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -228,7 +228,7 @@ public override async Task Include_nested_collection_on_collection(bool async) AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -237,7 +237,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -245,7 +245,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsMiscellaneousSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsMiscellaneousSqlServerTest.cs index 1b50f02e3e9..0c18bc6543a 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsMiscellaneousSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsMiscellaneousSqlServerTest.cs @@ -16,7 +16,7 @@ public override async Task Where_on_associate_scalar_property() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -25,7 +25,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -34,7 +34,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE [a].[Int] = 8 -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -44,7 +44,7 @@ public override async Task Where_on_optional_associate_scalar_property() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -53,7 +53,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -62,7 +62,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] WHERE [a].[Int] = 8 -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -72,7 +72,7 @@ public override async Task Where_on_nested_associate_scalar_property() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] INNER JOIN [NestedAssociateType] AS [n] ON [a].[RequiredNestedAssociateId] = [n].[Id] @@ -81,7 +81,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[RequiredNestedAssociateId] = [n1].[Id] LEFT JOIN [NestedAssociateType] AS [n2] ON [a].[OptionalNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -90,7 +90,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE [n].[Int] = 8 -ORDER BY [r].[Id], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -102,7 +102,7 @@ public override async Task FromSql_on_root() AssertSql( """ -SELECT [m].[Id], [m].[Name], [m].[OptionalAssociateId], [m].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [m].[Id], [m].[Name], [m].[OptionalAssociateId], [m].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM ( SELECT * FROM [RootEntity] ) AS [m] @@ -113,7 +113,7 @@ public override async Task FromSql_on_root() LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -121,7 +121,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [m].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [m].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [m].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsPrimitiveCollectionSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsPrimitiveCollectionSqlServerTest.cs index acbd2f5ed51..3e7c1840294 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsPrimitiveCollectionSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsPrimitiveCollectionSqlServerTest.cs @@ -12,7 +12,7 @@ public override async Task Count() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -21,7 +21,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -32,7 +32,7 @@ FROM [AssociateType] AS [a1] WHERE ( SELECT COUNT(*) FROM OPENJSON([a].[Ints]) AS [i]) = 3 -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -42,7 +42,7 @@ public override async Task Index() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -51,7 +51,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -60,7 +60,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE CAST(JSON_VALUE([a].[Ints], '$[0]') AS int) = 1 -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -70,7 +70,7 @@ public override async Task Contains() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -79,7 +79,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -91,7 +91,7 @@ WHERE 3 IN ( SELECT [i].[value] FROM OPENJSON([a].[Ints]) WITH ([value] int '$') AS [i] ) -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -101,7 +101,7 @@ public override async Task Any_predicate() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -110,7 +110,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -122,7 +122,7 @@ WHERE 2 IN ( SELECT [i].[value] FROM OPENJSON([a].[Ints]) WITH ([value] int '$') AS [i] ) -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -132,7 +132,7 @@ public override async Task Nested_Count() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] INNER JOIN [NestedAssociateType] AS [n] ON [a].[RequiredNestedAssociateId] = [n].[Id] @@ -141,7 +141,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[RequiredNestedAssociateId] = [n1].[Id] LEFT JOIN [NestedAssociateType] AS [n2] ON [a].[OptionalNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -152,7 +152,7 @@ FROM [AssociateType] AS [a1] WHERE ( SELECT COUNT(*) FROM OPENJSON([n].[Ints]) AS [i]) = 3 -ORDER BY [r].[Id], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsProjectionSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsProjectionSqlServerTest.cs index 2403bae3bdc..232b2041564 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsProjectionSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsProjectionSqlServerTest.cs @@ -12,7 +12,7 @@ public override async Task Select_root(QueryTrackingBehavior queryTrackingBehavi AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -21,7 +21,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -29,7 +29,7 @@ FROM [AssociateType] AS [a1] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -93,13 +93,13 @@ public override async Task Select_associate(QueryTrackingBehavior queryTrackingB AssertSql( """ -SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] +SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] INNER JOIN [NestedAssociateType] AS [n0] ON [a].[RequiredNestedAssociateId] = [n0].[Id] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[Id] = [n1].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id] +ORDER BY [r].[Id] """); } @@ -109,13 +109,13 @@ public override async Task Select_optional_associate(QueryTrackingBehavior query AssertSql( """ -SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] +SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] LEFT JOIN [NestedAssociateType] AS [n0] ON [a].[RequiredNestedAssociateId] = [n0].[Id] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[Id] = [n1].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id] +ORDER BY [r].[Id] """); } @@ -177,14 +177,14 @@ public override async Task Select_required_associate_via_optional_navigation(Que AssertSql( """ -SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [r0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] +SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] FROM [RootReferencingEntity] AS [r] LEFT JOIN [RootEntity] AS [r0] ON [r].[RootEntityId] = [r0].[Id] LEFT JOIN [AssociateType] AS [a] ON [r0].[RequiredAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] LEFT JOIN [NestedAssociateType] AS [n0] ON [a].[RequiredNestedAssociateId] = [n0].[Id] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[Id] = [n1].[CollectionAssociateId] -ORDER BY [r].[Id], [r0].[Id], [a].[Id], [n].[Id], [n0].[Id] +ORDER BY [r].[Id] """); } @@ -194,13 +194,13 @@ public override async Task Select_unmapped_associate_scalar_property(QueryTracki AssertSql( """ -SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] +SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] INNER JOIN [NestedAssociateType] AS [n0] ON [a].[RequiredNestedAssociateId] = [n0].[Id] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[Id] = [n1].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id] +ORDER BY [r].[Id] """); } @@ -226,16 +226,16 @@ public override async Task Select_associate_collection(QueryTrackingBehavior que AssertSql( """ -SELECT [r].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2] +SELECT [r].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2] FROM [RootEntity] AS [r] LEFT JOIN ( - SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n].[Id] AS [Id0], [n0].[Id] AS [Id1], [n1].[Id] AS [Id2], [n1].[CollectionAssociateId], [n1].[Int] AS [Int0], [n1].[Ints] AS [Ints0], [n1].[Name] AS [Name0], [n1].[String] AS [String0], [n].[CollectionAssociateId] AS [CollectionAssociateId0], [n].[Int] AS [Int1], [n].[Ints] AS [Ints1], [n].[Name] AS [Name1], [n].[String] AS [String1], [n0].[CollectionAssociateId] AS [CollectionAssociateId1], [n0].[Int] AS [Int2], [n0].[Ints] AS [Ints2], [n0].[Name] AS [Name2], [n0].[String] AS [String2] + SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n1].[Id] AS [Id0], [n1].[CollectionAssociateId], [n1].[Int] AS [Int0], [n1].[Ints] AS [Ints0], [n1].[Name] AS [Name0], [n1].[String] AS [String0], [n].[Id] AS [Id1], [n].[CollectionAssociateId] AS [CollectionAssociateId0], [n].[Int] AS [Int1], [n].[Ints] AS [Ints1], [n].[Name] AS [Name1], [n].[String] AS [String1], [n0].[Id] AS [Id2], [n0].[CollectionAssociateId] AS [CollectionAssociateId1], [n0].[Int] AS [Int2], [n0].[Ints] AS [Ints2], [n0].[Name] AS [Name2], [n0].[String] AS [String2] FROM [AssociateType] AS [a] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] INNER JOIN [NestedAssociateType] AS [n0] ON [a].[RequiredNestedAssociateId] = [n0].[Id] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[Id] = [n1].[CollectionAssociateId] ) AS [s] ON [r].[Id] = [s].[CollectionRootId] -ORDER BY [r].[Id], [s].[Id], [s].[Id0], [s].[Id1] +ORDER BY [r].[Id], [s].[Id] """); } @@ -245,11 +245,11 @@ public override async Task Select_nested_collection_on_required_associate(QueryT AssertSql( """ -SELECT [r].[Id], [a].[Id], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] +SELECT [r].[Id], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[Id] = [n].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id] +ORDER BY [r].[Id] """); } @@ -259,11 +259,11 @@ public override async Task Select_nested_collection_on_optional_associate(QueryT AssertSql( """ -SELECT [r].[Id], [a].[Id], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] +SELECT [r].[Id], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[Id] = [n].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id] +ORDER BY [r].[Id] """); } @@ -273,13 +273,13 @@ public override async Task SelectMany_associate_collection(QueryTrackingBehavior AssertSql( """ -SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] +SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [r].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[Id] = [a].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] INNER JOIN [NestedAssociateType] AS [n0] ON [a].[RequiredNestedAssociateId] = [n0].[Id] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[Id] = [n1].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id] +ORDER BY [r].[Id], [a].[Id] """); } @@ -319,7 +319,7 @@ public override async Task Select_root_duplicated(QueryTrackingBehavior queryTra AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [s0].[Id], [s0].[CollectionRootId], [s0].[Int], [s0].[Ints], [s0].[Name], [s0].[OptionalNestedAssociateId], [s0].[RequiredNestedAssociateId], [s0].[String], [s0].[Id0], [s0].[Id1], [s0].[Id2], [s0].[CollectionAssociateId], [s0].[Int0], [s0].[Ints0], [s0].[Name0], [s0].[String0], [s0].[CollectionAssociateId0], [s0].[Int1], [s0].[Ints1], [s0].[Name1], [s0].[String1], [s0].[CollectionAssociateId1], [s0].[Int2], [s0].[Ints2], [s0].[Name2], [s0].[String2], [n11].[Id], [n11].[CollectionAssociateId], [n11].[Int], [n11].[Ints], [n11].[Name], [n11].[String], [n12].[Id], [n12].[CollectionAssociateId], [n12].[Int], [n12].[Ints], [n12].[Name], [n12].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [s0].[Id], [s0].[CollectionRootId], [s0].[Int], [s0].[Ints], [s0].[Name], [s0].[OptionalNestedAssociateId], [s0].[RequiredNestedAssociateId], [s0].[String], [s0].[Id0], [s0].[CollectionAssociateId], [s0].[Int0], [s0].[Ints0], [s0].[Name0], [s0].[String0], [s0].[Id1], [s0].[CollectionAssociateId0], [s0].[Int1], [s0].[Ints1], [s0].[Name1], [s0].[String1], [s0].[Id2], [s0].[CollectionAssociateId1], [s0].[Int2], [s0].[Ints2], [s0].[Name2], [s0].[String2], [n11].[Id], [n11].[CollectionAssociateId], [n11].[Int], [n11].[Ints], [n11].[Name], [n11].[String], [n12].[Id], [n12].[CollectionAssociateId], [n12].[Int], [n12].[Ints], [n12].[Name], [n12].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -328,7 +328,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -337,7 +337,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] LEFT JOIN ( - SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n8].[Id] AS [Id0], [n9].[Id] AS [Id1], [n10].[Id] AS [Id2], [n10].[CollectionAssociateId], [n10].[Int] AS [Int0], [n10].[Ints] AS [Ints0], [n10].[Name] AS [Name0], [n10].[String] AS [String0], [n8].[CollectionAssociateId] AS [CollectionAssociateId0], [n8].[Int] AS [Int1], [n8].[Ints] AS [Ints1], [n8].[Name] AS [Name1], [n8].[String] AS [String1], [n9].[CollectionAssociateId] AS [CollectionAssociateId1], [n9].[Int] AS [Int2], [n9].[Ints] AS [Ints2], [n9].[Name] AS [Name2], [n9].[String] AS [String2] + SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n10].[Id] AS [Id0], [n10].[CollectionAssociateId], [n10].[Int] AS [Int0], [n10].[Ints] AS [Ints0], [n10].[Name] AS [Name0], [n10].[String] AS [String0], [n8].[Id] AS [Id1], [n8].[CollectionAssociateId] AS [CollectionAssociateId0], [n8].[Int] AS [Int1], [n8].[Ints] AS [Ints1], [n8].[Name] AS [Name1], [n8].[String] AS [String1], [n9].[Id] AS [Id2], [n9].[CollectionAssociateId] AS [CollectionAssociateId1], [n9].[Int] AS [Int2], [n9].[Ints] AS [Ints2], [n9].[Name] AS [Name2], [n9].[String] AS [String2] FROM [AssociateType] AS [a2] LEFT JOIN [NestedAssociateType] AS [n8] ON [a2].[OptionalNestedAssociateId] = [n8].[Id] INNER JOIN [NestedAssociateType] AS [n9] ON [a2].[RequiredNestedAssociateId] = [n9].[Id] @@ -345,7 +345,7 @@ FROM [AssociateType] AS [a2] ) AS [s0] ON [r].[Id] = [s0].[CollectionRootId] LEFT JOIN [NestedAssociateType] AS [n11] ON [a].[Id] = [n11].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n12] ON [a0].[Id] = [n12].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id], [n7].[Id], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [n11].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id], [n7].[Id], [s0].[Id], [s0].[Id0], [n11].[Id] """); } @@ -355,13 +355,13 @@ public override async Task Select_associate_and_target_to_index_based_binding_vi AssertSql( """ -SELECT [r].[Id], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n].[Id], [n0].[Id], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] +SELECT [r].[Id], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] INNER JOIN [NestedAssociateType] AS [n0] ON [a].[RequiredNestedAssociateId] = [n0].[Id] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[Id] = [n1].[CollectionAssociateId] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id] +ORDER BY [r].[Id] """); } @@ -375,7 +375,7 @@ public override async Task Select_subquery_FirstOrDefault_complex_collection(Que AssertSql( """ -SELECT [r].[Id], [r1].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [r1].[c] +SELECT [r].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [r1].[c] FROM [RootEntity] AS [r] OUTER APPLY ( SELECT TOP(1) 1 AS [c], [r0].[Id] @@ -383,13 +383,13 @@ FROM [RootEntity] AS [r0] ORDER BY [r0].[Id] ) AS [r1] LEFT JOIN ( - SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n].[Id] AS [Id0], [n0].[Id] AS [Id1], [n1].[Id] AS [Id2], [n1].[CollectionAssociateId], [n1].[Int] AS [Int0], [n1].[Ints] AS [Ints0], [n1].[Name] AS [Name0], [n1].[String] AS [String0], [n].[CollectionAssociateId] AS [CollectionAssociateId0], [n].[Int] AS [Int1], [n].[Ints] AS [Ints1], [n].[Name] AS [Name1], [n].[String] AS [String1], [n0].[CollectionAssociateId] AS [CollectionAssociateId1], [n0].[Int] AS [Int2], [n0].[Ints] AS [Ints2], [n0].[Name] AS [Name2], [n0].[String] AS [String2] + SELECT [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n1].[Id] AS [Id0], [n1].[CollectionAssociateId], [n1].[Int] AS [Int0], [n1].[Ints] AS [Ints0], [n1].[Name] AS [Name0], [n1].[String] AS [String0], [n].[Id] AS [Id1], [n].[CollectionAssociateId] AS [CollectionAssociateId0], [n].[Int] AS [Int1], [n].[Ints] AS [Ints1], [n].[Name] AS [Name1], [n].[String] AS [String1], [n0].[Id] AS [Id2], [n0].[CollectionAssociateId] AS [CollectionAssociateId1], [n0].[Int] AS [Int2], [n0].[Ints] AS [Ints2], [n0].[Name] AS [Name2], [n0].[String] AS [String2] FROM [AssociateType] AS [a] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] INNER JOIN [NestedAssociateType] AS [n0] ON [a].[RequiredNestedAssociateId] = [n0].[Id] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[Id] = [n1].[CollectionAssociateId] ) AS [s] ON [r1].[Id] = [s].[CollectionRootId] -ORDER BY [r].[Id], [r1].[Id], [s].[Id], [s].[Id0], [s].[Id1] +ORDER BY [r].[Id], [s].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsSetOperationsSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsSetOperationsSqlServerTest.cs index 3ea1f502fac..e93b56d973d 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsSetOperationsSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsSetOperationsSqlServerTest.cs @@ -14,7 +14,7 @@ public override async Task Over_associate_collections() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a1].[Id], [n].[Id], [n0].[Id], [a2].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a1] ON [r].[OptionalAssociateId] = [a1].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a1].[OptionalNestedAssociateId] = [n].[Id] @@ -23,7 +23,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a2].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a2].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a3].[Id], [a3].[CollectionRootId], [a3].[Int], [a3].[Ints], [a3].[Name], [a3].[OptionalNestedAssociateId], [a3].[RequiredNestedAssociateId], [a3].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a3].[Id], [a3].[CollectionRootId], [a3].[Int], [a3].[Ints], [a3].[Name], [a3].[OptionalNestedAssociateId], [a3].[RequiredNestedAssociateId], [a3].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a3] LEFT JOIN [NestedAssociateType] AS [n3] ON [a3].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a3].[RequiredNestedAssociateId] = [n4].[Id] @@ -42,7 +42,7 @@ SELECT 1 AS empty FROM [AssociateType] AS [a0] WHERE [r].[Id] = [a0].[CollectionRootId] AND [a0].[String] = N'foo' ) AS [u]) = 4 -ORDER BY [r].[Id], [a1].[Id], [n].[Id], [n0].[Id], [a2].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -85,7 +85,7 @@ public override async Task Over_nested_associate_collection() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [n4].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n9].[Id], [n9].[CollectionAssociateId], [n9].[Int], [n9].[Ints], [n9].[Name], [n9].[String], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String], [n4].[CollectionAssociateId], [n4].[Int], [n4].[Ints], [n4].[Name], [n4].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n9].[Id], [n9].[CollectionAssociateId], [n9].[Int], [n9].[Ints], [n9].[Name], [n9].[String], [n3].[Id], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String], [n4].[Id], [n4].[CollectionAssociateId], [n4].[Int], [n4].[Ints], [n4].[Name], [n4].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -94,7 +94,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n3] ON [a].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a].[RequiredNestedAssociateId] = [n4].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n6].[Id] AS [Id1], [n7].[Id] AS [Id2], [n7].[CollectionAssociateId], [n7].[Int] AS [Int0], [n7].[Ints] AS [Ints0], [n7].[Name] AS [Name0], [n7].[String] AS [String0], [n5].[CollectionAssociateId] AS [CollectionAssociateId0], [n5].[Int] AS [Int1], [n5].[Ints] AS [Ints1], [n5].[Name] AS [Name1], [n5].[String] AS [String1], [n6].[CollectionAssociateId] AS [CollectionAssociateId1], [n6].[Int] AS [Int2], [n6].[Ints] AS [Ints2], [n6].[Name] AS [Name2], [n6].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id] AS [Id0], [n7].[CollectionAssociateId], [n7].[Int] AS [Int0], [n7].[Ints] AS [Ints0], [n7].[Name] AS [Name0], [n7].[String] AS [String0], [n5].[Id] AS [Id1], [n5].[CollectionAssociateId] AS [CollectionAssociateId0], [n5].[Int] AS [Int1], [n5].[Ints] AS [Ints1], [n5].[Name] AS [Name1], [n5].[String] AS [String1], [n6].[Id] AS [Id2], [n6].[CollectionAssociateId] AS [CollectionAssociateId1], [n6].[Int] AS [Int2], [n6].[Ints] AS [Ints2], [n6].[Name] AS [Name2], [n6].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n5] ON [a1].[OptionalNestedAssociateId] = [n5].[Id] INNER JOIN [NestedAssociateType] AS [n6] ON [a1].[RequiredNestedAssociateId] = [n6].[Id] @@ -113,7 +113,7 @@ SELECT 1 AS empty FROM [NestedAssociateType] AS [n0] WHERE [a].[Id] = [n0].[CollectionAssociateId] AND [n0].[String] = N'foo' ) AS [u]) = 4 -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [n4].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n8].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n8].[Id] """); } @@ -123,7 +123,7 @@ public override async Task Over_different_collection_properties() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [n4].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n9].[Id], [n9].[CollectionAssociateId], [n9].[Int], [n9].[Ints], [n9].[Name], [n9].[String], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String], [n4].[CollectionAssociateId], [n4].[Int], [n4].[Ints], [n4].[Name], [n4].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n9].[Id], [n9].[CollectionAssociateId], [n9].[Int], [n9].[Ints], [n9].[Name], [n9].[String], [n3].[Id], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String], [n4].[Id], [n4].[CollectionAssociateId], [n4].[Int], [n4].[Ints], [n4].[Name], [n4].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -132,7 +132,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n3] ON [a].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a].[RequiredNestedAssociateId] = [n4].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n6].[Id] AS [Id1], [n7].[Id] AS [Id2], [n7].[CollectionAssociateId], [n7].[Int] AS [Int0], [n7].[Ints] AS [Ints0], [n7].[Name] AS [Name0], [n7].[String] AS [String0], [n5].[CollectionAssociateId] AS [CollectionAssociateId0], [n5].[Int] AS [Int1], [n5].[Ints] AS [Ints1], [n5].[Name] AS [Name1], [n5].[String] AS [String1], [n6].[CollectionAssociateId] AS [CollectionAssociateId1], [n6].[Int] AS [Int2], [n6].[Ints] AS [Ints2], [n6].[Name] AS [Name2], [n6].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id] AS [Id0], [n7].[CollectionAssociateId], [n7].[Int] AS [Int0], [n7].[Ints] AS [Ints0], [n7].[Name] AS [Name0], [n7].[String] AS [String0], [n5].[Id] AS [Id1], [n5].[CollectionAssociateId] AS [CollectionAssociateId0], [n5].[Int] AS [Int1], [n5].[Ints] AS [Ints1], [n5].[Name] AS [Name1], [n5].[String] AS [String1], [n6].[Id] AS [Id2], [n6].[CollectionAssociateId] AS [CollectionAssociateId1], [n6].[Int] AS [Int2], [n6].[Ints] AS [Ints2], [n6].[Name] AS [Name2], [n6].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n5] ON [a1].[OptionalNestedAssociateId] = [n5].[Id] INNER JOIN [NestedAssociateType] AS [n6] ON [a1].[RequiredNestedAssociateId] = [n6].[Id] @@ -151,7 +151,7 @@ SELECT 1 AS empty FROM [NestedAssociateType] AS [n0] WHERE [a0].[Id] IS NOT NULL AND [a0].[Id] = [n0].[CollectionAssociateId] ) AS [u]) = 4 -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [n4].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n8].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n8].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsStructuralEqualitySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsStructuralEqualitySqlServerTest.cs index 17eff5f0b9d..2d4e5a054aa 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsStructuralEqualitySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/Navigations/NavigationsStructuralEqualitySqlServerTest.cs @@ -14,7 +14,7 @@ public override async Task Two_associates() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -23,7 +23,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -32,7 +32,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE [a].[Id] = [a0].[Id] -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -42,7 +42,7 @@ public override async Task Two_nested_associates() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] INNER JOIN [NestedAssociateType] AS [n] ON [a].[RequiredNestedAssociateId] = [n].[Id] @@ -51,7 +51,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] LEFT JOIN [NestedAssociateType] AS [n2] ON [a].[OptionalNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -60,7 +60,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE [n].[Id] = [n0].[Id] -ORDER BY [r].[Id], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -70,7 +70,7 @@ public override async Task Not_equals() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -79,7 +79,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -88,7 +88,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE [a].[Id] <> [a0].[Id] OR [a0].[Id] IS NULL -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -98,7 +98,7 @@ public override async Task Associate_with_inline_null() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -107,7 +107,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -116,7 +116,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] WHERE [a].[Id] IS NULL -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -126,7 +126,7 @@ public override async Task Associate_with_parameter_null() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a] ON [r].[OptionalAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -135,7 +135,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a0].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -144,7 +144,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a0].[Id] = [n7].[CollectionAssociateId] WHERE [a].[Id] IS NULL -ORDER BY [r].[Id], [a].[Id], [n].[Id], [n0].[Id], [a0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -154,7 +154,7 @@ public override async Task Nested_associate_with_inline_null() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a].[OptionalNestedAssociateId] = [n].[Id] @@ -163,7 +163,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[RequiredNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -172,7 +172,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE [n].[Id] IS NULL -ORDER BY [r].[Id], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -182,7 +182,7 @@ public override async Task Nested_associate_with_inline() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] INNER JOIN [NestedAssociateType] AS [n] ON [a].[RequiredNestedAssociateId] = [n].[Id] @@ -191,7 +191,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[RequiredNestedAssociateId] = [n1].[Id] LEFT JOIN [NestedAssociateType] AS [n2] ON [a].[OptionalNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -200,7 +200,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE [n].[Id] = 1000 -ORDER BY [r].[Id], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -212,7 +212,7 @@ public override async Task Nested_associate_with_parameter() """ @entity_equality_nested_Id='1000' (Nullable = true) -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] INNER JOIN [NestedAssociateType] AS [n] ON [a].[RequiredNestedAssociateId] = [n].[Id] @@ -221,7 +221,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a0].[RequiredNestedAssociateId] = [n1].[Id] LEFT JOIN [NestedAssociateType] AS [n2] ON [a].[OptionalNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -230,7 +230,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE [n].[Id] = @entity_equality_nested_Id -ORDER BY [r].[Id], [a].[Id], [n].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -240,7 +240,7 @@ public override async Task Two_nested_collections() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -249,7 +249,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n3] ON [a1].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a1].[RequiredNestedAssociateId] = [n4].[Id] @@ -258,7 +258,7 @@ FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n6] ON [a0].[Id] = [n6].[CollectionAssociateId] LEFT JOIN [NestedAssociateType] AS [n7] ON [a].[Id] = [n7].[CollectionAssociateId] WHERE [a].[Id] = [a0].[Id] -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } @@ -284,7 +284,7 @@ public override async Task Contains_with_inline() AssertSql( """ -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n3].[Id], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -293,7 +293,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n2] ON [a].[OptionalNestedAssociateId] = [n2].[Id] INNER JOIN [NestedAssociateType] AS [n3] ON [a].[RequiredNestedAssociateId] = [n3].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n4].[Id] AS [Id0], [n5].[Id] AS [Id1], [n6].[Id] AS [Id2], [n6].[CollectionAssociateId], [n6].[Int] AS [Int0], [n6].[Ints] AS [Ints0], [n6].[Name] AS [Name0], [n6].[String] AS [String0], [n4].[CollectionAssociateId] AS [CollectionAssociateId0], [n4].[Int] AS [Int1], [n4].[Ints] AS [Ints1], [n4].[Name] AS [Name1], [n4].[String] AS [String1], [n5].[CollectionAssociateId] AS [CollectionAssociateId1], [n5].[Int] AS [Int2], [n5].[Ints] AS [Ints2], [n5].[Name] AS [Name2], [n5].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n6].[Id] AS [Id0], [n6].[CollectionAssociateId], [n6].[Int] AS [Int0], [n6].[Ints] AS [Ints0], [n6].[Name] AS [Name0], [n6].[String] AS [String0], [n4].[Id] AS [Id1], [n4].[CollectionAssociateId] AS [CollectionAssociateId0], [n4].[Int] AS [Int1], [n4].[Ints] AS [Ints1], [n4].[Name] AS [Name1], [n4].[String] AS [String1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId] AS [CollectionAssociateId1], [n5].[Int] AS [Int2], [n5].[Ints] AS [Ints2], [n5].[Name] AS [Name2], [n5].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n4] ON [a1].[OptionalNestedAssociateId] = [n4].[Id] INNER JOIN [NestedAssociateType] AS [n5] ON [a1].[RequiredNestedAssociateId] = [n5].[Id] @@ -305,7 +305,7 @@ WHERE EXISTS ( SELECT 1 FROM [NestedAssociateType] AS [n] WHERE [a].[Id] = [n].[CollectionAssociateId] AND [n].[Id] = 1002) -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n7].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n7].[Id] """); } @@ -317,7 +317,7 @@ public override async Task Contains_with_parameter() """ @entity_equality_nested_Id='1002' (Nullable = true) -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n3].[Id], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -326,7 +326,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n2] ON [a].[OptionalNestedAssociateId] = [n2].[Id] INNER JOIN [NestedAssociateType] AS [n3] ON [a].[RequiredNestedAssociateId] = [n3].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n4].[Id] AS [Id0], [n5].[Id] AS [Id1], [n6].[Id] AS [Id2], [n6].[CollectionAssociateId], [n6].[Int] AS [Int0], [n6].[Ints] AS [Ints0], [n6].[Name] AS [Name0], [n6].[String] AS [String0], [n4].[CollectionAssociateId] AS [CollectionAssociateId0], [n4].[Int] AS [Int1], [n4].[Ints] AS [Ints1], [n4].[Name] AS [Name1], [n4].[String] AS [String1], [n5].[CollectionAssociateId] AS [CollectionAssociateId1], [n5].[Int] AS [Int2], [n5].[Ints] AS [Ints2], [n5].[Name] AS [Name2], [n5].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n6].[Id] AS [Id0], [n6].[CollectionAssociateId], [n6].[Int] AS [Int0], [n6].[Ints] AS [Ints0], [n6].[Name] AS [Name0], [n6].[String] AS [String0], [n4].[Id] AS [Id1], [n4].[CollectionAssociateId] AS [CollectionAssociateId0], [n4].[Int] AS [Int1], [n4].[Ints] AS [Ints1], [n4].[Name] AS [Name1], [n4].[String] AS [String1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId] AS [CollectionAssociateId1], [n5].[Int] AS [Int2], [n5].[Ints] AS [Ints2], [n5].[Name] AS [Name2], [n5].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n4] ON [a1].[OptionalNestedAssociateId] = [n4].[Id] INNER JOIN [NestedAssociateType] AS [n5] ON [a1].[RequiredNestedAssociateId] = [n5].[Id] @@ -338,7 +338,7 @@ WHERE EXISTS ( SELECT 1 FROM [NestedAssociateType] AS [n] WHERE [a].[Id] = [n].[CollectionAssociateId] AND [n].[Id] = @entity_equality_nested_Id) -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n7].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n7].[Id] """); } @@ -351,7 +351,7 @@ public override async Task Contains_with_operators_composed_on_the_collection() @get_Item_Int='106' @entity_equality_get_Item_Id='3003' (Nullable = true) -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [a].[Id], [a].[CollectionRootId], [a].[Int], [a].[Ints], [a].[Name], [a].[OptionalNestedAssociateId], [a].[RequiredNestedAssociateId], [a].[String], [n8].[Id], [n8].[CollectionAssociateId], [n8].[Int], [n8].[Ints], [n8].[Name], [n8].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String], [n3].[Id], [n3].[CollectionAssociateId], [n3].[Int], [n3].[Ints], [n3].[Name], [n3].[String] FROM [RootEntity] AS [r] INNER JOIN [AssociateType] AS [a] ON [r].[RequiredAssociateId] = [a].[Id] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] @@ -360,7 +360,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n2] ON [a].[OptionalNestedAssociateId] = [n2].[Id] INNER JOIN [NestedAssociateType] AS [n3] ON [a].[RequiredNestedAssociateId] = [n3].[Id] LEFT JOIN ( - SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n4].[Id] AS [Id0], [n5].[Id] AS [Id1], [n6].[Id] AS [Id2], [n6].[CollectionAssociateId], [n6].[Int] AS [Int0], [n6].[Ints] AS [Ints0], [n6].[Name] AS [Name0], [n6].[String] AS [String0], [n4].[CollectionAssociateId] AS [CollectionAssociateId0], [n4].[Int] AS [Int1], [n4].[Ints] AS [Ints1], [n4].[Name] AS [Name1], [n4].[String] AS [String1], [n5].[CollectionAssociateId] AS [CollectionAssociateId1], [n5].[Int] AS [Int2], [n5].[Ints] AS [Ints2], [n5].[Name] AS [Name2], [n5].[String] AS [String2] + SELECT [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n6].[Id] AS [Id0], [n6].[CollectionAssociateId], [n6].[Int] AS [Int0], [n6].[Ints] AS [Ints0], [n6].[Name] AS [Name0], [n6].[String] AS [String0], [n4].[Id] AS [Id1], [n4].[CollectionAssociateId] AS [CollectionAssociateId0], [n4].[Int] AS [Int1], [n4].[Ints] AS [Ints1], [n4].[Name] AS [Name1], [n4].[String] AS [String1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId] AS [CollectionAssociateId1], [n5].[Int] AS [Int2], [n5].[Ints] AS [Ints2], [n5].[Name] AS [Name2], [n5].[String] AS [String2] FROM [AssociateType] AS [a1] LEFT JOIN [NestedAssociateType] AS [n4] ON [a1].[OptionalNestedAssociateId] = [n4].[Id] INNER JOIN [NestedAssociateType] AS [n5] ON [a1].[RequiredNestedAssociateId] = [n5].[Id] @@ -372,7 +372,7 @@ WHERE EXISTS ( SELECT 1 FROM [NestedAssociateType] AS [n] WHERE [a].[Id] = [n].[CollectionAssociateId] AND [n].[Int] > @get_Item_Int AND [n].[Id] = @entity_equality_get_Item_Id) -ORDER BY [r].[Id], [a].[Id], [a0].[Id], [n0].[Id], [n1].[Id], [n2].[Id], [n3].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n7].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n7].[Id] """); } @@ -385,7 +385,7 @@ public override async Task Contains_with_nested_and_composed_operators() @get_Item_Id='302' @entity_equality_get_Item_Id='303' (Nullable = true) -SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[Id1], [s].[Id2], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] +SELECT [r].[Id], [r].[Name], [r].[OptionalAssociateId], [r].[RequiredAssociateId], [s].[Id], [s].[CollectionRootId], [s].[Int], [s].[Ints], [s].[Name], [s].[OptionalNestedAssociateId], [s].[RequiredNestedAssociateId], [s].[String], [s].[Id0], [s].[CollectionAssociateId], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[CollectionAssociateId0], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[CollectionAssociateId1], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [a0].[Id], [a0].[CollectionRootId], [a0].[Int], [a0].[Ints], [a0].[Name], [a0].[OptionalNestedAssociateId], [a0].[RequiredNestedAssociateId], [a0].[String], [n6].[Id], [n6].[CollectionAssociateId], [n6].[Int], [n6].[Ints], [n6].[Name], [n6].[String], [n].[Id], [n].[CollectionAssociateId], [n].[Int], [n].[Ints], [n].[Name], [n].[String], [n0].[Id], [n0].[CollectionAssociateId], [n0].[Int], [n0].[Ints], [n0].[Name], [n0].[String], [a1].[Id], [a1].[CollectionRootId], [a1].[Int], [a1].[Ints], [a1].[Name], [a1].[OptionalNestedAssociateId], [a1].[RequiredNestedAssociateId], [a1].[String], [n7].[Id], [n7].[CollectionAssociateId], [n7].[Int], [n7].[Ints], [n7].[Name], [n7].[String], [n1].[Id], [n1].[CollectionAssociateId], [n1].[Int], [n1].[Ints], [n1].[Name], [n1].[String], [n2].[Id], [n2].[CollectionAssociateId], [n2].[Int], [n2].[Ints], [n2].[Name], [n2].[String] FROM [RootEntity] AS [r] LEFT JOIN [AssociateType] AS [a0] ON [r].[OptionalAssociateId] = [a0].[Id] LEFT JOIN [NestedAssociateType] AS [n] ON [a0].[OptionalNestedAssociateId] = [n].[Id] @@ -394,7 +394,7 @@ FROM [RootEntity] AS [r] LEFT JOIN [NestedAssociateType] AS [n1] ON [a1].[OptionalNestedAssociateId] = [n1].[Id] INNER JOIN [NestedAssociateType] AS [n2] ON [a1].[RequiredNestedAssociateId] = [n2].[Id] LEFT JOIN ( - SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n3].[Id] AS [Id0], [n4].[Id] AS [Id1], [n5].[Id] AS [Id2], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] + SELECT [a2].[Id], [a2].[CollectionRootId], [a2].[Int], [a2].[Ints], [a2].[Name], [a2].[OptionalNestedAssociateId], [a2].[RequiredNestedAssociateId], [a2].[String], [n5].[Id] AS [Id0], [n5].[CollectionAssociateId], [n5].[Int] AS [Int0], [n5].[Ints] AS [Ints0], [n5].[Name] AS [Name0], [n5].[String] AS [String0], [n3].[Id] AS [Id1], [n3].[CollectionAssociateId] AS [CollectionAssociateId0], [n3].[Int] AS [Int1], [n3].[Ints] AS [Ints1], [n3].[Name] AS [Name1], [n3].[String] AS [String1], [n4].[Id] AS [Id2], [n4].[CollectionAssociateId] AS [CollectionAssociateId1], [n4].[Int] AS [Int2], [n4].[Ints] AS [Ints2], [n4].[Name] AS [Name2], [n4].[String] AS [String2] FROM [AssociateType] AS [a2] LEFT JOIN [NestedAssociateType] AS [n3] ON [a2].[OptionalNestedAssociateId] = [n3].[Id] INNER JOIN [NestedAssociateType] AS [n4] ON [a2].[RequiredNestedAssociateId] = [n4].[Id] @@ -406,7 +406,7 @@ WHERE EXISTS ( SELECT 1 FROM [AssociateType] AS [a] WHERE [r].[Id] = [a].[CollectionRootId] AND [a].[Id] > @get_Item_Id AND [a].[Id] = @entity_equality_get_Item_Id) -ORDER BY [r].[Id], [a0].[Id], [n].[Id], [n0].[Id], [a1].[Id], [n1].[Id], [n2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [n6].[Id] +ORDER BY [r].[Id], [s].[Id], [s].[Id0], [n6].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsProjectionSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsProjectionSqlServerTest.cs index 8b57be8d69c..d27d6d21e1c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsProjectionSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsProjectionSqlServerTest.cs @@ -197,14 +197,14 @@ public override async Task Select_required_associate_via_optional_navigation(Que { AssertSql( """ -SELECT [r1].[RootEntityId], [r1].[Id], [r1].[Int], [r1].[Ints], [r1].[Name], [r1].[String], [r].[Id], [r0].[Id], [r2].[AssociateTypeRootEntityId], [r3].[AssociateTypeRootEntityId], [r4].[AssociateTypeRootEntityId], [r4].[Id], [r4].[Int], [r4].[Ints], [r4].[Name], [r4].[String], [r2].[Id], [r2].[Int], [r2].[Ints], [r2].[Name], [r2].[String], [r3].[Id], [r3].[Int], [r3].[Ints], [r3].[Name], [r3].[String] +SELECT [r1].[RootEntityId], [r1].[Id], [r1].[Int], [r1].[Ints], [r1].[Name], [r1].[String], [r].[Id], [r2].[AssociateTypeRootEntityId], [r3].[AssociateTypeRootEntityId], [r4].[AssociateTypeRootEntityId], [r4].[Id], [r4].[Int], [r4].[Ints], [r4].[Name], [r4].[String], [r2].[Id], [r2].[Int], [r2].[Ints], [r2].[Name], [r2].[String], [r3].[Id], [r3].[Int], [r3].[Ints], [r3].[Name], [r3].[String] FROM [RootReferencingEntity] AS [r] LEFT JOIN [RootEntity] AS [r0] ON [r].[RootEntityId] = [r0].[Id] LEFT JOIN [RequiredRelated] AS [r1] ON [r0].[Id] = [r1].[RootEntityId] LEFT JOIN [RequiredRelated_OptionalNested] AS [r2] ON [r1].[RootEntityId] = [r2].[AssociateTypeRootEntityId] LEFT JOIN [RequiredRelated_RequiredNested] AS [r3] ON [r1].[RootEntityId] = [r3].[AssociateTypeRootEntityId] LEFT JOIN [RequiredRelated_NestedCollection] AS [r4] ON [r1].[RootEntityId] = [r4].[AssociateTypeRootEntityId] -ORDER BY [r].[Id], [r0].[Id], [r1].[RootEntityId], [r2].[AssociateTypeRootEntityId], [r3].[AssociateTypeRootEntityId], [r4].[AssociateTypeRootEntityId] +ORDER BY [r].[Id], [r1].[RootEntityId], [r2].[AssociateTypeRootEntityId], [r3].[AssociateTypeRootEntityId], [r4].[AssociateTypeRootEntityId] """); } } @@ -422,7 +422,7 @@ public override async Task Select_subquery_FirstOrDefault_complex_collection(Que { AssertSql( """ -SELECT [r].[Id], [r5].[Id], [s].[RootEntityId], [s].[Id], [s].[Int], [s].[Ints], [s].[Name], [s].[String], [s].[AssociateTypeRootEntityId], [s].[AssociateTypeId], [s].[AssociateTypeRootEntityId0], [s].[AssociateTypeId0], [s].[AssociateTypeRootEntityId1], [s].[AssociateTypeId1], [s].[Id0], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [r5].[c] +SELECT [r].[Id], [s].[RootEntityId], [s].[Id], [s].[Int], [s].[Ints], [s].[Name], [s].[String], [s].[AssociateTypeRootEntityId], [s].[AssociateTypeId], [s].[AssociateTypeRootEntityId0], [s].[AssociateTypeId0], [s].[AssociateTypeRootEntityId1], [s].[AssociateTypeId1], [s].[Id0], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[Id1], [s].[Int1], [s].[Ints1], [s].[Name1], [s].[String1], [s].[Id2], [s].[Int2], [s].[Ints2], [s].[Name2], [s].[String2], [r5].[c] FROM [RootEntity] AS [r] OUTER APPLY ( SELECT TOP(1) 1 AS [c], [r0].[Id] @@ -436,7 +436,7 @@ FROM [RelatedCollection] AS [r1] LEFT JOIN [RelatedCollection_RequiredNested] AS [r3] ON [r1].[RootEntityId] = [r3].[AssociateTypeRootEntityId] AND [r1].[Id] = [r3].[AssociateTypeId] LEFT JOIN [RelatedCollection_NestedCollection] AS [r4] ON [r1].[RootEntityId] = [r4].[AssociateTypeRootEntityId] AND [r1].[Id] = [r4].[AssociateTypeId] ) AS [s] ON [r5].[Id] = [s].[RootEntityId] -ORDER BY [r].[Id], [r5].[Id], [s].[RootEntityId], [s].[Id], [s].[AssociateTypeRootEntityId], [s].[AssociateTypeId], [s].[AssociateTypeRootEntityId0], [s].[AssociateTypeId0], [s].[AssociateTypeRootEntityId1], [s].[AssociateTypeId1] +ORDER BY [r].[Id], [s].[RootEntityId], [s].[Id], [s].[AssociateTypeRootEntityId], [s].[AssociateTypeId], [s].[AssociateTypeRootEntityId0], [s].[AssociateTypeId0], [s].[AssociateTypeRootEntityId1], [s].[AssociateTypeId1] """); } } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingProjectionSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingProjectionSqlServerTest.cs index 7ac9f81e98e..887c458bf6d 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingProjectionSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/OwnedTableSplitting/OwnedTableSplittingProjectionSqlServerTest.cs @@ -179,7 +179,7 @@ public override async Task Select_required_associate_via_optional_navigation(Que FROM [RootReferencingEntity] AS [r] LEFT JOIN [RootEntity] AS [r0] ON [r].[RootEntityId] = [r0].[Id] LEFT JOIN [RequiredRelated_NestedCollection] AS [r1] ON [r0].[Id] = [r1].[AssociateTypeRootEntityId] -ORDER BY [r].[Id], [r0].[Id], [r1].[AssociateTypeRootEntityId] +ORDER BY [r].[Id], [r1].[AssociateTypeRootEntityId] """); } } @@ -380,7 +380,7 @@ public override async Task Select_subquery_FirstOrDefault_complex_collection(Que { AssertSql( """ -SELECT [r].[Id], [r3].[Id], [s].[RootEntityId], [s].[Id], [s].[Int], [s].[Ints], [s].[Name], [s].[String], [s].[AssociateTypeRootEntityId], [s].[AssociateTypeId], [s].[Id0], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[OptionalNestedAssociate_Id], [s].[OptionalNestedAssociate_Int], [s].[OptionalNestedAssociate_Ints], [s].[OptionalNestedAssociate_Name], [s].[OptionalNestedAssociate_String], [s].[RequiredNestedAssociate_Id], [s].[RequiredNestedAssociate_Int], [s].[RequiredNestedAssociate_Ints], [s].[RequiredNestedAssociate_Name], [s].[RequiredNestedAssociate_String], [r3].[c] +SELECT [r].[Id], [s].[RootEntityId], [s].[Id], [s].[Int], [s].[Ints], [s].[Name], [s].[String], [s].[AssociateTypeRootEntityId], [s].[AssociateTypeId], [s].[Id0], [s].[Int0], [s].[Ints0], [s].[Name0], [s].[String0], [s].[OptionalNestedAssociate_Id], [s].[OptionalNestedAssociate_Int], [s].[OptionalNestedAssociate_Ints], [s].[OptionalNestedAssociate_Name], [s].[OptionalNestedAssociate_String], [s].[RequiredNestedAssociate_Id], [s].[RequiredNestedAssociate_Int], [s].[RequiredNestedAssociate_Ints], [s].[RequiredNestedAssociate_Name], [s].[RequiredNestedAssociate_String], [r3].[c] FROM [RootEntity] AS [r] OUTER APPLY ( SELECT TOP(1) 1 AS [c], [r0].[Id] @@ -392,7 +392,7 @@ LEFT JOIN ( FROM [RelatedCollection] AS [r1] LEFT JOIN [RelatedCollection_NestedCollection] AS [r2] ON [r1].[RootEntityId] = [r2].[AssociateTypeRootEntityId] AND [r1].[Id] = [r2].[AssociateTypeId] ) AS [s] ON [r3].[Id] = [s].[RootEntityId] -ORDER BY [r].[Id], [r3].[Id], [s].[RootEntityId], [s].[Id], [s].[AssociateTypeRootEntityId], [s].[AssociateTypeId] +ORDER BY [r].[Id], [s].[RootEntityId], [s].[Id], [s].[AssociateTypeRootEntityId], [s].[AssociateTypeId] """); } } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsQuerySqlServerTest.cs index e3d172f871e..5add0eb1aff 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsQuerySqlServerTest.cs @@ -58,7 +58,7 @@ FROM [LevelThree] AS [l1] LEFT JOIN [LevelThree] AS [l3] ON [l2].[Id] = [l3].[OneToMany_Optional_Inverse3Id] ) AS [s] ON [l0].[Id] = [s].[OneToMany_Optional_Inverse3Id] ) AS [s0] ON [l].[Id] = [s0].[OneToMany_Optional_Inverse2Id] -ORDER BY [l].[Id], [s0].[Id], [s0].[Id0], [s0].[Id00] +ORDER BY [l].[Id], [s0].[Id], [s0].[Id0] """); } @@ -96,7 +96,7 @@ LEFT JOIN ( FROM [LevelOne] AS [l2] LEFT JOIN [LevelOne] AS [l3] ON [l2].[OneToOne_Optional_Self1Id] = [l3].[Id] ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Self_Inverse1Id] -ORDER BY [l].[Id], [l0].[Id], [l1].[Id], [s].[Id] +ORDER BY [l].[Id], [l1].[Id] """); } @@ -503,20 +503,20 @@ await base.Complex_SelectMany_with_nested_navigations_and_explicit_DefaultIfEmpt AssertSql( """ -SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l12].[Id], [l13].[Id], [l14].[Id], [l16].[Id], [l16].[Date], [l16].[Level1_Optional_Id], [l16].[Level1_Required_Id], [l16].[Name], [l16].[OneToMany_Optional_Inverse2Id], [l16].[OneToMany_Optional_Self_Inverse2Id], [l16].[OneToMany_Required_Inverse2Id], [l16].[OneToMany_Required_Self_Inverse2Id], [l16].[OneToOne_Optional_PK_Inverse2Id], [l16].[OneToOne_Optional_Self2Id], [l14].[Name] +SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l12].[Id], [l14].[Id], [l16].[Id], [l16].[Date], [l16].[Level1_Optional_Id], [l16].[Level1_Required_Id], [l16].[Name], [l16].[OneToMany_Optional_Inverse2Id], [l16].[OneToMany_Optional_Self_Inverse2Id], [l16].[OneToMany_Required_Inverse2Id], [l16].[OneToMany_Required_Self_Inverse2Id], [l16].[OneToOne_Optional_PK_Inverse2Id], [l16].[OneToOne_Optional_Self2Id], [l14].[Name] FROM [LevelOne] AS [l] LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[Level1_Required_Id] LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[Level2_Optional_Id] LEFT JOIN [LevelFour] AS [l2] ON [l1].[Id] = [l2].[OneToMany_Required_Inverse4Id] INNER JOIN ( - SELECT [l3].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l6].[Id] AS [Id2] + SELECT [l3].[Id], [l6].[Id] AS [Id2] FROM [LevelFour] AS [l3] INNER JOIN [LevelThree] AS [l4] ON [l3].[Level3_Required_Id] = [l4].[Id] LEFT JOIN [LevelTwo] AS [l5] ON [l4].[Level2_Optional_Id] = [l5].[Id] LEFT JOIN [LevelTwo] AS [l6] ON [l5].[Id] = [l6].[OneToMany_Required_Self_Inverse2Id] ) AS [s] ON [l2].[Id] = [s].[Id2] LEFT JOIN ( - SELECT [l7].[Id], [l8].[Id] AS [Id0], [l9].[Id] AS [Id1], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] + SELECT [l7].[Id], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] FROM [LevelFour] AS [l7] INNER JOIN [LevelThree] AS [l8] ON [l7].[Level3_Required_Id] = [l8].[Id] INNER JOIN [LevelTwo] AS [l9] ON [l8].[Level2_Required_Id] = [l9].[Id] @@ -532,7 +532,7 @@ FROM [LevelTwo] AS [l15] WHERE [l15].[Id] <> 42 ) AS [l16] ON [s].[Id2] = [l16].[OneToMany_Optional_Self_Inverse2Id] WHERE [l11].[Name] <> N'Foo' OR [l11].[Name] IS NULL -ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l13].[Id], [l14].[Id] +ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l14].[Id] """); } @@ -755,7 +755,7 @@ FROM [LevelOne] AS [l0] WHERE [l3].[row] <= 1 ) AS [l4] ON [l2].[Name] = [l4].[Name] LEFT JOIN [LevelTwo] AS [l1] ON [l4].[Id] = [l1].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -782,7 +782,7 @@ WHERE [l0].[Id] > 3 WHERE [l3].[row] <= 1 ) AS [l4] ON [l2].[Name] = [l4].[Name] LEFT JOIN [LevelTwo] AS [l1] ON [l4].[Id] = [l1].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -808,7 +808,7 @@ FROM [LevelOne] AS [l0] WHERE [l3].[row] <= 1 ) AS [l4] ON [l2].[Name] = [l4].[Name] LEFT JOIN [LevelTwo] AS [l1] ON [l4].[Id] = [l1].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -1177,7 +1177,7 @@ public override async Task Lift_projection_mapping_when_pushing_down_subquery(bo """ @p='25' -SELECT [l2].[Id], [l4].[Id], [l1].[Id], [l4].[c] +SELECT [l2].[Id], [l1].[Id], [l4].[Id], [l4].[c] FROM ( SELECT TOP(@p) [l].[Id] FROM [LevelOne] AS [l] @@ -1191,7 +1191,7 @@ FROM [LevelTwo] AS [l0] WHERE [l3].[row] <= 1 ) AS [l4] ON [l2].[Id] = [l4].[OneToMany_Required_Inverse2Id] LEFT JOIN [LevelTwo] AS [l1] ON [l2].[Id] = [l1].[OneToMany_Required_Inverse2Id] -ORDER BY [l2].[Id], [l4].[Id] +ORDER BY [l2].[Id] """); } @@ -1237,7 +1237,7 @@ public override async Task Select_subquery_single_nested_subquery(bool async) AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l1].[Id], [l3].[c] +SELECT [l].[Id], [l1].[Id], [l3].[c] FROM [LevelOne] AS [l] LEFT JOIN ( SELECT [l2].[c], [l2].[Id], [l2].[OneToMany_Optional_Inverse2Id] @@ -1248,7 +1248,7 @@ FROM [LevelTwo] AS [l0] WHERE [l2].[row] <= 1 ) AS [l3] ON [l].[Id] = [l3].[OneToMany_Optional_Inverse2Id] LEFT JOIN [LevelThree] AS [l1] ON [l3].[Id] = [l1].[OneToMany_Optional_Inverse3Id] -ORDER BY [l].[Id], [l3].[Id], [l1].[Id] +ORDER BY [l].[Id], [l1].[Id] """); } @@ -1258,10 +1258,10 @@ public override async Task Select_subquery_single_nested_subquery2(bool async) AssertSql( """ -SELECT [l].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[c] +SELECT [l].[Id], [s].[Id], [s].[Id0], [s].[c] FROM [LevelOne] AS [l] LEFT JOIN ( - SELECT [l0].[Id], [l4].[Id] AS [Id0], [l2].[Id] AS [Id1], [l4].[c], [l0].[OneToMany_Optional_Inverse2Id] + SELECT [l0].[Id], [l2].[Id] AS [Id0], [l4].[c], [l0].[OneToMany_Optional_Inverse2Id] FROM [LevelTwo] AS [l0] LEFT JOIN ( SELECT [l3].[c], [l3].[Id], [l3].[OneToMany_Optional_Inverse3Id] @@ -1273,7 +1273,7 @@ FROM [LevelThree] AS [l1] ) AS [l4] ON [l0].[Id] = [l4].[OneToMany_Optional_Inverse3Id] LEFT JOIN [LevelFour] AS [l2] ON [l4].[Id] = [l2].[OneToMany_Optional_Inverse4Id] ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Inverse2Id] -ORDER BY [l].[Id], [s].[Id], [s].[Id0], [s].[Id1] +ORDER BY [l].[Id], [s].[Id], [s].[Id0] """); } @@ -1844,7 +1844,7 @@ public override async Task Complex_query_with_let_collection_projection_FirstOrD AssertSql( """ -SELECT [l].[Id], [l4].[Id], [l5].[Name], [l5].[Id], [l4].[c] +SELECT [l].[Id], [l5].[Name], [l5].[Id], [l4].[c] FROM [LevelOne] AS [l] LEFT JOIN ( SELECT [l3].[c], [l3].[Id], [l3].[OneToMany_Optional_Inverse2Id] @@ -1863,7 +1863,7 @@ SELECT 1 FROM [LevelTwo] AS [l2] WHERE [l1].[Id] = [l2].[OneToMany_Optional_Inverse2Id] AND [l2].[Id] = [l4].[Id]) ) AS [l5] -ORDER BY [l].[Id], [l4].[Id] +ORDER BY [l].[Id] """); } @@ -1873,20 +1873,20 @@ public override async Task SelectMany_DefaultIfEmpty_multiple_times_with_joins_p AssertSql( """ -SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l12].[Id], [l13].[Id], [l14].[Id], [l16].[Id], [l16].[Date], [l16].[Level1_Optional_Id], [l16].[Level1_Required_Id], [l16].[Name], [l16].[OneToMany_Optional_Inverse2Id], [l16].[OneToMany_Optional_Self_Inverse2Id], [l16].[OneToMany_Required_Inverse2Id], [l16].[OneToMany_Required_Self_Inverse2Id], [l16].[OneToOne_Optional_PK_Inverse2Id], [l16].[OneToOne_Optional_Self2Id], [l14].[Name] +SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l12].[Id], [l14].[Id], [l16].[Id], [l16].[Date], [l16].[Level1_Optional_Id], [l16].[Level1_Required_Id], [l16].[Name], [l16].[OneToMany_Optional_Inverse2Id], [l16].[OneToMany_Optional_Self_Inverse2Id], [l16].[OneToMany_Required_Inverse2Id], [l16].[OneToMany_Required_Self_Inverse2Id], [l16].[OneToOne_Optional_PK_Inverse2Id], [l16].[OneToOne_Optional_Self2Id], [l14].[Name] FROM [LevelOne] AS [l] LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[Level1_Required_Id] LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[Level2_Optional_Id] LEFT JOIN [LevelFour] AS [l2] ON [l1].[Id] = [l2].[OneToMany_Required_Inverse4Id] INNER JOIN ( - SELECT [l3].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l6].[Id] AS [Id2] + SELECT [l3].[Id], [l6].[Id] AS [Id2] FROM [LevelFour] AS [l3] INNER JOIN [LevelThree] AS [l4] ON [l3].[Level3_Required_Id] = [l4].[Id] LEFT JOIN [LevelTwo] AS [l5] ON [l4].[Level2_Optional_Id] = [l5].[Id] LEFT JOIN [LevelTwo] AS [l6] ON [l5].[Id] = [l6].[OneToMany_Required_Self_Inverse2Id] ) AS [s] ON [l2].[Id] = [s].[Id2] LEFT JOIN ( - SELECT [l7].[Id], [l8].[Id] AS [Id0], [l9].[Id] AS [Id1], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] + SELECT [l7].[Id], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] FROM [LevelFour] AS [l7] INNER JOIN [LevelThree] AS [l8] ON [l7].[Level3_Required_Id] = [l8].[Id] INNER JOIN [LevelTwo] AS [l9] ON [l8].[Level2_Required_Id] = [l9].[Id] @@ -1902,7 +1902,7 @@ FROM [LevelTwo] AS [l15] WHERE [l15].[Id] <> 42 ) AS [l16] ON [s].[Id2] = [l16].[OneToMany_Optional_Self_Inverse2Id] WHERE [l11].[Name] <> N'Foo' OR [l11].[Name] IS NULL -ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l13].[Id], [l14].[Id] +ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l14].[Id] """); } @@ -2653,7 +2653,7 @@ public override async Task Complex_query_with_let_collection_projection_FirstOrD AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l4].[Name], [l4].[Id], [l3].[c] +SELECT [l].[Id], [l4].[Name], [l4].[Id], [l3].[c] FROM [LevelOne] AS [l] OUTER APPLY ( SELECT TOP(1) 1 AS [c], [l0].[Id] @@ -2668,7 +2668,7 @@ SELECT 1 FROM [LevelTwo] AS [l2] WHERE [l1].[Id] = [l2].[OneToMany_Optional_Inverse2Id] AND [l2].[Id] = [l3].[Id]) ) AS [l4] -ORDER BY [l].[Id], [l3].[Id] +ORDER BY [l].[Id] """); } @@ -2772,7 +2772,7 @@ LEFT JOIN ( FROM [LevelOne] AS [l2] LEFT JOIN [LevelOne] AS [l3] ON [l2].[OneToOne_Optional_Self1Id] = [l3].[Id] ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Self_Inverse1Id] -ORDER BY [l].[Id], [l0].[Id], [l1].[Id], [s].[Id] +ORDER BY [l].[Id], [l1].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs index 7cea1548613..6a2f55f863b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs @@ -27,10 +27,10 @@ public override async Task Complex_query_with_let_collection_projection_FirstOrD AssertSql( """ -SELECT [l].[Id], [s].[Id], [s].[Id0], [l5].[Name], [l5].[Id], [s].[c] +SELECT [l].[Id], [l5].[Name], [l5].[Id], [s].[c] FROM [Level1] AS [l] OUTER APPLY ( - SELECT TOP(1) 1 AS [c], [l0].[Id], [l2].[Id] AS [Id0], [l2].[OneToOne_Required_PK_Date], [l2].[Level1_Required_Id], [l2].[OneToMany_Required_Inverse2Id] + SELECT TOP(1) 1 AS [c], [l2].[Id] AS [Id0], [l2].[OneToOne_Required_PK_Date], [l2].[Level1_Required_Id], [l2].[OneToMany_Required_Inverse2Id] FROM [Level1] AS [l0] LEFT JOIN ( SELECT [l1].[Id], [l1].[OneToOne_Required_PK_Date], [l1].[Level1_Required_Id], [l1].[Level2_Name], [l1].[OneToMany_Required_Inverse2Id] @@ -51,7 +51,7 @@ FROM [Level1] AS [l4] WHEN [s].[OneToOne_Required_PK_Date] IS NOT NULL AND [s].[Level1_Required_Id] IS NOT NULL AND [s].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [s].[Id0] END) ) AS [l5] -ORDER BY [l].[Id], [s].[Id], [s].[Id0] +ORDER BY [l].[Id] """); } @@ -132,7 +132,7 @@ WHEN [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] ) AS [l2] INNER JOIN [Level1] AS [l1] ON [l2].[Level1_Required_Id] = [l1].[Id] ) AS [s] -ORDER BY [l3].[Id], [s].[c], [s].[Id1] +ORDER BY [l3].[Id], [s].[c] """); } @@ -168,7 +168,7 @@ OFFSET 1 ROWS FETCH NEXT 3 ROWS ONLY ) AS [l2] INNER JOIN [Level1] AS [l1] ON [l2].[Level1_Required_Id] = [l1].[Id] ) AS [s] -ORDER BY [l3].[Id], [s].[c], [s].[Id1] +ORDER BY [l3].[Id], [s].[c] """); } @@ -569,10 +569,10 @@ public override async Task Select_subquery_single_nested_subquery2(bool async) AssertSql( """ -SELECT [l].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id00], [s].[c] +SELECT [l].[Id], [s].[Id], [s].[Id0], [s].[Id00], [s].[c] FROM [Level1] AS [l] LEFT JOIN ( - SELECT [l0].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l5].[Id0] AS [Id00], [l4].[c], CASE + SELECT [l0].[Id], [l5].[Id] AS [Id0], [l5].[Id0] AS [Id00], [l4].[c], CASE WHEN [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] IS NOT NULL AND [l0].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l0].[Id] END AS [c0], [l0].[OneToMany_Optional_Inverse2Id] FROM [Level1] AS [l0] @@ -600,7 +600,7 @@ WHEN [l4].[Level2_Required_Id] IS NOT NULL AND [l4].[OneToMany_Required_Inverse3 END = [l5].[OneToMany_Optional_Inverse4Id] WHERE [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] IS NOT NULL AND [l0].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Inverse2Id] -ORDER BY [l].[Id], [s].[c0], [s].[Id], [s].[Id0], [s].[Id1] +ORDER BY [l].[Id], [s].[c0], [s].[Id], [s].[Id0] """); } @@ -1033,7 +1033,7 @@ LEFT JOIN ( FROM [Level1] AS [l1] WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l5] ON [l4].[Id] = [l5].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -1307,7 +1307,7 @@ LEFT JOIN ( FROM [Level1] AS [l1] WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l5] ON [l4].[Id] = [l5].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -1371,17 +1371,17 @@ public override async Task Lift_projection_mapping_when_pushing_down_subquery(bo """ @p='25' -SELECT [l2].[Id], [l4].[Id0], [l5].[Id], [l5].[Id0], [l4].[Id], [l4].[c] +SELECT [l2].[Id], [l5].[Id], [l5].[Id0], [l4].[Id], [l4].[c] FROM ( SELECT TOP(@p) [l].[Id] FROM [Level1] AS [l] ) AS [l2] LEFT JOIN ( - SELECT [l3].[Id], [l3].[c], [l3].[Id0], [l3].[OneToMany_Required_Inverse2Id] + SELECT [l3].[Id], [l3].[c], [l3].[OneToMany_Required_Inverse2Id] FROM ( SELECT CASE WHEN [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] IS NOT NULL AND [l0].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l0].[Id] - END AS [Id], 1 AS [c], [l0].[Id] AS [Id0], [l0].[OneToMany_Required_Inverse2Id], ROW_NUMBER() OVER(PARTITION BY [l0].[OneToMany_Required_Inverse2Id] ORDER BY [l0].[Id]) AS [row] + END AS [Id], 1 AS [c], [l0].[OneToMany_Required_Inverse2Id], ROW_NUMBER() OVER(PARTITION BY [l0].[OneToMany_Required_Inverse2Id] ORDER BY [l0].[Id]) AS [row] FROM [Level1] AS [l0] WHERE [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] IS NOT NULL AND [l0].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l3] @@ -1394,7 +1394,7 @@ WHEN [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] FROM [Level1] AS [l1] WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l5] ON [l2].[Id] = [l5].[OneToMany_Required_Inverse2Id] -ORDER BY [l2].[Id], [l4].[Id0] +ORDER BY [l2].[Id] """); } @@ -2171,7 +2171,7 @@ public override async Task Complex_query_with_let_collection_projection_FirstOrD AssertSql( """ -SELECT [l].[Id], [l4].[Id], [l5].[Name], [l5].[Id], [l4].[c] +SELECT [l].[Id], [l5].[Name], [l5].[Id], [l4].[c] FROM [Level1] AS [l] LEFT JOIN ( SELECT [l3].[c], [l3].[Id], [l3].[OneToOne_Required_PK_Date], [l3].[Level1_Required_Id], [l3].[OneToMany_Required_Inverse2Id], [l3].[OneToMany_Optional_Inverse2Id] @@ -2192,7 +2192,7 @@ FROM [Level1] AS [l2] WHEN [l4].[OneToOne_Required_PK_Date] IS NOT NULL AND [l4].[Level1_Required_Id] IS NOT NULL AND [l4].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l4].[Id] END) ) AS [l5] -ORDER BY [l].[Id], [l4].[Id] +ORDER BY [l].[Id] """); } @@ -2341,7 +2341,7 @@ public override async Task Select_subquery_single_nested_subquery(bool async) AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l4].[Id], [l4].[Id0], [l3].[c] +SELECT [l].[Id], [l4].[Id], [l4].[Id0], [l3].[c] FROM [Level1] AS [l] LEFT JOIN ( SELECT [l2].[c], [l2].[Id], [l2].[OneToOne_Required_PK_Date], [l2].[Level1_Required_Id], [l2].[OneToMany_Required_Inverse2Id], [l2].[OneToMany_Optional_Inverse2Id] @@ -2363,7 +2363,7 @@ WHERE [l1].[Level2_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse ) AS [l4] ON CASE WHEN [l3].[OneToOne_Required_PK_Date] IS NOT NULL AND [l3].[Level1_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l3].[Id] END = [l4].[OneToMany_Optional_Inverse3Id] -ORDER BY [l].[Id], [l3].[Id], [l4].[Id] +ORDER BY [l].[Id], [l4].[Id] """); } @@ -2449,7 +2449,7 @@ LEFT JOIN ( FROM [Level1] AS [l1] WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l5] ON [l4].[Id] = [l5].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSplitQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSplitQuerySqlServerTest.cs index 397431f911c..44ffaa18aae 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSplitQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsCollectionsSplitQuerySqlServerTest.cs @@ -920,20 +920,20 @@ await base.Complex_SelectMany_with_nested_navigations_and_explicit_DefaultIfEmpt AssertSql( """ -SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l12].[Id], [l13].[Id], [l14].[Id], [l14].[Name] +SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l12].[Id], [l14].[Id], [l14].[Name] FROM [LevelOne] AS [l] LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[Level1_Required_Id] LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[Level2_Optional_Id] LEFT JOIN [LevelFour] AS [l2] ON [l1].[Id] = [l2].[OneToMany_Required_Inverse4Id] INNER JOIN ( - SELECT [l3].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l6].[Id] AS [Id2] + SELECT [l3].[Id], [l6].[Id] AS [Id2] FROM [LevelFour] AS [l3] INNER JOIN [LevelThree] AS [l4] ON [l3].[Level3_Required_Id] = [l4].[Id] LEFT JOIN [LevelTwo] AS [l5] ON [l4].[Level2_Optional_Id] = [l5].[Id] LEFT JOIN [LevelTwo] AS [l6] ON [l5].[Id] = [l6].[OneToMany_Required_Self_Inverse2Id] ) AS [s] ON [l2].[Id] = [s].[Id2] LEFT JOIN ( - SELECT [l7].[Id], [l8].[Id] AS [Id0], [l9].[Id] AS [Id1], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] + SELECT [l7].[Id], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] FROM [LevelFour] AS [l7] INNER JOIN [LevelThree] AS [l8] ON [l7].[Level3_Required_Id] = [l8].[Id] INNER JOIN [LevelTwo] AS [l9] ON [l8].[Level2_Required_Id] = [l9].[Id] @@ -944,24 +944,24 @@ FROM [LevelFour] AS [l7] LEFT JOIN [LevelTwo] AS [l13] ON [s0].[Level2_Optional_Id0] = [l13].[Id] LEFT JOIN [LevelThree] AS [l14] ON [l13].[Id] = [l14].[Level2_Required_Id] WHERE [l11].[Name] <> N'Foo' OR [l11].[Name] IS NULL -ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l13].[Id], [l14].[Id] +ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l14].[Id] """, // """ -SELECT [l18].[Id], [l18].[Date], [l18].[Level1_Optional_Id], [l18].[Level1_Required_Id], [l18].[Name], [l18].[OneToMany_Optional_Inverse2Id], [l18].[OneToMany_Optional_Self_Inverse2Id], [l18].[OneToMany_Required_Inverse2Id], [l18].[OneToMany_Required_Self_Inverse2Id], [l18].[OneToOne_Optional_PK_Inverse2Id], [l18].[OneToOne_Optional_Self2Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l12].[Id], [l13].[Id], [l14].[Id] +SELECT [l18].[Id], [l18].[Date], [l18].[Level1_Optional_Id], [l18].[Level1_Required_Id], [l18].[Name], [l18].[OneToMany_Optional_Inverse2Id], [l18].[OneToMany_Optional_Self_Inverse2Id], [l18].[OneToMany_Required_Inverse2Id], [l18].[OneToMany_Required_Self_Inverse2Id], [l18].[OneToOne_Optional_PK_Inverse2Id], [l18].[OneToOne_Optional_Self2Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l12].[Id], [l14].[Id] FROM [LevelOne] AS [l] LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[Level1_Required_Id] LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[Level2_Optional_Id] LEFT JOIN [LevelFour] AS [l2] ON [l1].[Id] = [l2].[OneToMany_Required_Inverse4Id] INNER JOIN ( - SELECT [l3].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l6].[Id] AS [Id2] + SELECT [l3].[Id], [l6].[Id] AS [Id2] FROM [LevelFour] AS [l3] INNER JOIN [LevelThree] AS [l4] ON [l3].[Level3_Required_Id] = [l4].[Id] LEFT JOIN [LevelTwo] AS [l5] ON [l4].[Level2_Optional_Id] = [l5].[Id] LEFT JOIN [LevelTwo] AS [l6] ON [l5].[Id] = [l6].[OneToMany_Required_Self_Inverse2Id] ) AS [s] ON [l2].[Id] = [s].[Id2] LEFT JOIN ( - SELECT [l7].[Id], [l8].[Id] AS [Id0], [l9].[Id] AS [Id1], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] + SELECT [l7].[Id], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] FROM [LevelFour] AS [l7] INNER JOIN [LevelThree] AS [l8] ON [l7].[Level3_Required_Id] = [l8].[Id] INNER JOIN [LevelTwo] AS [l9] ON [l8].[Level2_Required_Id] = [l9].[Id] @@ -977,7 +977,7 @@ FROM [LevelTwo] AS [l17] WHERE [l17].[Id] <> 42 ) AS [l18] ON [s].[Id2] = [l18].[OneToMany_Optional_Self_Inverse2Id] WHERE [l11].[Name] <> N'Foo' OR [l11].[Name] IS NULL -ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l13].[Id], [l14].[Id] +ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l14].[Id] """); } @@ -1388,21 +1388,21 @@ public override async Task Select_subquery_single_nested_subquery(bool async) AssertSql( """ -SELECT [l].[Id], [l2].[Id], [l2].[c] +SELECT [l].[Id], [l2].[c] FROM [LevelOne] AS [l] LEFT JOIN ( - SELECT [l1].[c], [l1].[Id], [l1].[OneToMany_Optional_Inverse2Id] + SELECT [l1].[c], [l1].[OneToMany_Optional_Inverse2Id] FROM ( - SELECT 1 AS [c], [l0].[Id], [l0].[OneToMany_Optional_Inverse2Id], ROW_NUMBER() OVER(PARTITION BY [l0].[OneToMany_Optional_Inverse2Id] ORDER BY [l0].[Id]) AS [row] + SELECT 1 AS [c], [l0].[OneToMany_Optional_Inverse2Id], ROW_NUMBER() OVER(PARTITION BY [l0].[OneToMany_Optional_Inverse2Id] ORDER BY [l0].[Id]) AS [row] FROM [LevelTwo] AS [l0] ) AS [l1] WHERE [l1].[row] <= 1 ) AS [l2] ON [l].[Id] = [l2].[OneToMany_Optional_Inverse2Id] -ORDER BY [l].[Id], [l2].[Id] +ORDER BY [l].[Id] """, // """ -SELECT [l11].[Id], [l].[Id], [l13].[Id] +SELECT [l11].[Id], [l].[Id] FROM [LevelOne] AS [l] LEFT JOIN ( SELECT [l12].[Id], [l12].[OneToMany_Optional_Inverse2Id] @@ -1413,7 +1413,7 @@ FROM [LevelTwo] AS [l8] WHERE [l12].[row] <= 1 ) AS [l13] ON [l].[Id] = [l13].[OneToMany_Optional_Inverse2Id] INNER JOIN [LevelThree] AS [l11] ON [l13].[Id] = [l11].[OneToMany_Optional_Inverse3Id] -ORDER BY [l].[Id], [l13].[Id], [l11].[Id] +ORDER BY [l].[Id], [l11].[Id] """); } @@ -1429,22 +1429,22 @@ ORDER BY [l].[Id] """, // """ -SELECT [l].[Id], [l26].[Id], [l40].[Id], [l40].[c] +SELECT [l].[Id], [l26].[Id], [l40].[c] FROM [LevelOne] AS [l] INNER JOIN [LevelTwo] AS [l26] ON [l].[Id] = [l26].[OneToMany_Optional_Inverse2Id] LEFT JOIN ( - SELECT [l39].[c], [l39].[Id], [l39].[OneToMany_Optional_Inverse3Id] + SELECT [l39].[c], [l39].[OneToMany_Optional_Inverse3Id] FROM ( - SELECT 1 AS [c], [l35].[Id], [l35].[OneToMany_Optional_Inverse3Id], ROW_NUMBER() OVER(PARTITION BY [l35].[OneToMany_Optional_Inverse3Id] ORDER BY [l35].[Id]) AS [row] + SELECT 1 AS [c], [l35].[OneToMany_Optional_Inverse3Id], ROW_NUMBER() OVER(PARTITION BY [l35].[OneToMany_Optional_Inverse3Id] ORDER BY [l35].[Id]) AS [row] FROM [LevelThree] AS [l35] ) AS [l39] WHERE [l39].[row] <= 1 ) AS [l40] ON [l26].[Id] = [l40].[OneToMany_Optional_Inverse3Id] -ORDER BY [l].[Id], [l26].[Id], [l40].[Id] +ORDER BY [l].[Id], [l26].[Id] """, // """ -SELECT [l38].[Id], [l].[Id], [l26].[Id], [l40].[Id] +SELECT [l38].[Id], [l].[Id], [l26].[Id] FROM [LevelOne] AS [l] INNER JOIN [LevelTwo] AS [l26] ON [l].[Id] = [l26].[OneToMany_Optional_Inverse2Id] LEFT JOIN ( @@ -1456,7 +1456,7 @@ FROM [LevelThree] AS [l35] WHERE [l39].[row] <= 1 ) AS [l40] ON [l26].[Id] = [l40].[OneToMany_Optional_Inverse3Id] INNER JOIN [LevelFour] AS [l38] ON [l40].[Id] = [l38].[OneToMany_Optional_Inverse4Id] -ORDER BY [l].[Id], [l26].[Id], [l40].[Id], [l38].[Id] +ORDER BY [l].[Id], [l26].[Id], [l38].[Id] """); } @@ -1473,18 +1473,18 @@ public override async Task Complex_query_with_let_collection_projection_FirstOrD AssertSql( """ -SELECT [l].[Id], [l1].[Id], [l1].[c] +SELECT [l].[Id], [l1].[c] FROM [LevelOne] AS [l] OUTER APPLY ( - SELECT TOP(1) 1 AS [c], [l0].[Id] + SELECT TOP(1) 1 AS [c] FROM [LevelTwo] AS [l0] WHERE [l0].[Name] <> N'Foo' OR [l0].[Name] IS NULL ) AS [l1] -ORDER BY [l].[Id], [l1].[Id] +ORDER BY [l].[Id] """, // """ -SELECT [l29].[Name], [l].[Id], [l28].[Id] +SELECT [l29].[Name], [l].[Id] FROM [LevelOne] AS [l] OUTER APPLY ( SELECT TOP(1) [l21].[Id] @@ -1499,7 +1499,7 @@ SELECT 1 FROM [LevelTwo] AS [l27] WHERE [l26].[Id] = [l27].[OneToMany_Optional_Inverse2Id] AND [l27].[Id] = [l28].[Id]) ) AS [l29] -ORDER BY [l].[Id], [l28].[Id] +ORDER BY [l].[Id] """); } @@ -1509,22 +1509,22 @@ public override async Task Complex_query_with_let_collection_projection_FirstOrD AssertSql( """ -SELECT [l].[Id], [l2].[Id], [l2].[c] +SELECT [l].[Id], [l2].[c] FROM [LevelOne] AS [l] LEFT JOIN ( - SELECT [l1].[c], [l1].[Id], [l1].[OneToMany_Optional_Inverse2Id] + SELECT [l1].[c], [l1].[OneToMany_Optional_Inverse2Id] FROM ( - SELECT 1 AS [c], [l0].[Id], [l0].[OneToMany_Optional_Inverse2Id], ROW_NUMBER() OVER(PARTITION BY [l0].[OneToMany_Optional_Inverse2Id] ORDER BY [l0].[Id]) AS [row] + SELECT 1 AS [c], [l0].[OneToMany_Optional_Inverse2Id], ROW_NUMBER() OVER(PARTITION BY [l0].[OneToMany_Optional_Inverse2Id] ORDER BY [l0].[Id]) AS [row] FROM [LevelTwo] AS [l0] WHERE [l0].[Name] <> N'Foo' OR [l0].[Name] IS NULL ) AS [l1] WHERE [l1].[row] <= 1 ) AS [l2] ON [l].[Id] = [l2].[OneToMany_Optional_Inverse2Id] -ORDER BY [l].[Id], [l2].[Id] +ORDER BY [l].[Id] """, // """ -SELECT [l23].[Name], [l].[Id], [l22].[Id] +SELECT [l23].[Name], [l].[Id] FROM [LevelOne] AS [l] LEFT JOIN ( SELECT [l21].[Id], [l21].[OneToMany_Optional_Inverse2Id] @@ -1543,7 +1543,7 @@ SELECT 1 FROM [LevelTwo] AS [l20] WHERE [l19].[Id] = [l20].[OneToMany_Optional_Inverse2Id] AND [l20].[Id] = [l22].[Id]) ) AS [l23] -ORDER BY [l].[Id], [l22].[Id] +ORDER BY [l].[Id] """); } @@ -1553,20 +1553,20 @@ public override async Task SelectMany_DefaultIfEmpty_multiple_times_with_joins_p AssertSql( """ -SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l12].[Id], [l13].[Id], [l14].[Id], [l14].[Name] +SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l12].[Id], [l14].[Id], [l14].[Name] FROM [LevelOne] AS [l] LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[Level1_Required_Id] LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[Level2_Optional_Id] LEFT JOIN [LevelFour] AS [l2] ON [l1].[Id] = [l2].[OneToMany_Required_Inverse4Id] INNER JOIN ( - SELECT [l3].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l6].[Id] AS [Id2] + SELECT [l3].[Id], [l6].[Id] AS [Id2] FROM [LevelFour] AS [l3] INNER JOIN [LevelThree] AS [l4] ON [l3].[Level3_Required_Id] = [l4].[Id] LEFT JOIN [LevelTwo] AS [l5] ON [l4].[Level2_Optional_Id] = [l5].[Id] LEFT JOIN [LevelTwo] AS [l6] ON [l5].[Id] = [l6].[OneToMany_Required_Self_Inverse2Id] ) AS [s] ON [l2].[Id] = [s].[Id2] LEFT JOIN ( - SELECT [l7].[Id], [l8].[Id] AS [Id0], [l9].[Id] AS [Id1], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] + SELECT [l7].[Id], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] FROM [LevelFour] AS [l7] INNER JOIN [LevelThree] AS [l8] ON [l7].[Level3_Required_Id] = [l8].[Id] INNER JOIN [LevelTwo] AS [l9] ON [l8].[Level2_Required_Id] = [l9].[Id] @@ -1577,24 +1577,24 @@ FROM [LevelFour] AS [l7] LEFT JOIN [LevelTwo] AS [l13] ON [s0].[Level2_Optional_Id0] = [l13].[Id] LEFT JOIN [LevelThree] AS [l14] ON [l13].[Id] = [l14].[Level2_Required_Id] WHERE [l11].[Name] <> N'Foo' OR [l11].[Name] IS NULL -ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l13].[Id], [l14].[Id] +ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l14].[Id] """, // """ -SELECT [l18].[Id], [l18].[Date], [l18].[Level1_Optional_Id], [l18].[Level1_Required_Id], [l18].[Name], [l18].[OneToMany_Optional_Inverse2Id], [l18].[OneToMany_Optional_Self_Inverse2Id], [l18].[OneToMany_Required_Inverse2Id], [l18].[OneToMany_Required_Self_Inverse2Id], [l18].[OneToOne_Optional_PK_Inverse2Id], [l18].[OneToOne_Optional_Self2Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l12].[Id], [l13].[Id], [l14].[Id] +SELECT [l18].[Id], [l18].[Date], [l18].[Level1_Optional_Id], [l18].[Level1_Required_Id], [l18].[Name], [l18].[OneToMany_Optional_Inverse2Id], [l18].[OneToMany_Optional_Self_Inverse2Id], [l18].[OneToMany_Required_Inverse2Id], [l18].[OneToMany_Required_Self_Inverse2Id], [l18].[OneToOne_Optional_PK_Inverse2Id], [l18].[OneToOne_Optional_Self2Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l12].[Id], [l14].[Id] FROM [LevelOne] AS [l] LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[Level1_Required_Id] LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[Level2_Optional_Id] LEFT JOIN [LevelFour] AS [l2] ON [l1].[Id] = [l2].[OneToMany_Required_Inverse4Id] INNER JOIN ( - SELECT [l3].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l6].[Id] AS [Id2] + SELECT [l3].[Id], [l6].[Id] AS [Id2] FROM [LevelFour] AS [l3] INNER JOIN [LevelThree] AS [l4] ON [l3].[Level3_Required_Id] = [l4].[Id] LEFT JOIN [LevelTwo] AS [l5] ON [l4].[Level2_Optional_Id] = [l5].[Id] LEFT JOIN [LevelTwo] AS [l6] ON [l5].[Id] = [l6].[OneToMany_Required_Self_Inverse2Id] ) AS [s] ON [l2].[Id] = [s].[Id2] LEFT JOIN ( - SELECT [l7].[Id], [l8].[Id] AS [Id0], [l9].[Id] AS [Id1], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] + SELECT [l7].[Id], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] FROM [LevelFour] AS [l7] INNER JOIN [LevelThree] AS [l8] ON [l7].[Level3_Required_Id] = [l8].[Id] INNER JOIN [LevelTwo] AS [l9] ON [l8].[Level2_Required_Id] = [l9].[Id] @@ -1610,7 +1610,7 @@ FROM [LevelTwo] AS [l17] WHERE [l17].[Id] <> 42 ) AS [l18] ON [s].[Id2] = [l18].[OneToMany_Optional_Self_Inverse2Id] WHERE [l11].[Name] <> N'Foo' OR [l11].[Name] IS NULL -ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l13].[Id], [l14].[Id] +ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l14].[Id] """); } @@ -1745,11 +1745,11 @@ INNER JOIN ( FROM [LevelThree] AS [l1] INNER JOIN [LevelTwo] AS [l2] ON [l1].[OneToMany_Required_Inverse3Id] = [l2].[Id] ) AS [s] ON [l0].[Id] = [s].[OneToMany_Optional_Inverse3Id] -ORDER BY [l].[Id], [l0].[Id], [s].[Id], [s].[Id0] +ORDER BY [l].[Id], [l0].[Id], [s].[Id] """, // """ -SELECT [l3].[Id], [l3].[Level2_Optional_Id], [l3].[Level2_Required_Id], [l3].[Name], [l3].[OneToMany_Optional_Inverse3Id], [l3].[OneToMany_Optional_Self_Inverse3Id], [l3].[OneToMany_Required_Inverse3Id], [l3].[OneToMany_Required_Self_Inverse3Id], [l3].[OneToOne_Optional_PK_Inverse3Id], [l3].[OneToOne_Optional_Self3Id], [l].[Id], [l0].[Id], [s].[Id], [s].[Id0] +SELECT [l3].[Id], [l3].[Level2_Optional_Id], [l3].[Level2_Required_Id], [l3].[Name], [l3].[OneToMany_Optional_Inverse3Id], [l3].[OneToMany_Optional_Self_Inverse3Id], [l3].[OneToMany_Required_Inverse3Id], [l3].[OneToMany_Required_Self_Inverse3Id], [l3].[OneToOne_Optional_PK_Inverse3Id], [l3].[OneToOne_Optional_Self3Id], [l].[Id], [l0].[Id], [s].[Id] FROM [LevelOne] AS [l] INNER JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[OneToMany_Optional_Inverse2Id] INNER JOIN ( @@ -1758,7 +1758,7 @@ FROM [LevelThree] AS [l1] INNER JOIN [LevelTwo] AS [l2] ON [l1].[OneToMany_Required_Inverse3Id] = [l2].[Id] ) AS [s] ON [l0].[Id] = [s].[OneToMany_Optional_Inverse3Id] INNER JOIN [LevelThree] AS [l3] ON [s].[Id0] = [l3].[OneToMany_Optional_Inverse3Id] -ORDER BY [l].[Id], [l0].[Id], [s].[Id], [s].[Id0] +ORDER BY [l].[Id], [l0].[Id], [s].[Id] """); } @@ -1804,27 +1804,26 @@ public override async Task Multiple_complex_includes_self_ref(bool async) SELECT [l].[Id], [l].[Date], [l].[Name], [l].[OneToMany_Optional_Self_Inverse1Id], [l].[OneToMany_Required_Self_Inverse1Id], [l].[OneToOne_Optional_Self1Id], [l0].[Id], [l0].[Date], [l0].[Name], [l0].[OneToMany_Optional_Self_Inverse1Id], [l0].[OneToMany_Required_Self_Inverse1Id], [l0].[OneToOne_Optional_Self1Id] FROM [LevelOne] AS [l] LEFT JOIN [LevelOne] AS [l0] ON [l].[OneToOne_Optional_Self1Id] = [l0].[Id] -ORDER BY [l].[Id], [l0].[Id] +ORDER BY [l].[Id] """, // """ -SELECT [l1].[Id], [l1].[Date], [l1].[Name], [l1].[OneToMany_Optional_Self_Inverse1Id], [l1].[OneToMany_Required_Self_Inverse1Id], [l1].[OneToOne_Optional_Self1Id], [l].[Id], [l0].[Id] +SELECT [l1].[Id], [l1].[Date], [l1].[Name], [l1].[OneToMany_Optional_Self_Inverse1Id], [l1].[OneToMany_Required_Self_Inverse1Id], [l1].[OneToOne_Optional_Self1Id], [l].[Id] FROM [LevelOne] AS [l] LEFT JOIN [LevelOne] AS [l0] ON [l].[OneToOne_Optional_Self1Id] = [l0].[Id] INNER JOIN [LevelOne] AS [l1] ON [l0].[Id] = [l1].[OneToMany_Optional_Self_Inverse1Id] -ORDER BY [l].[Id], [l0].[Id] +ORDER BY [l].[Id] """, // """ -SELECT [s].[Id], [s].[Date], [s].[Name], [s].[OneToMany_Optional_Self_Inverse1Id], [s].[OneToMany_Required_Self_Inverse1Id], [s].[OneToOne_Optional_Self1Id], [s].[Id0], [s].[Date0], [s].[Name0], [s].[OneToMany_Optional_Self_Inverse1Id0], [s].[OneToMany_Required_Self_Inverse1Id0], [s].[OneToOne_Optional_Self1Id0], [l].[Id], [l0].[Id] +SELECT [s].[Id], [s].[Date], [s].[Name], [s].[OneToMany_Optional_Self_Inverse1Id], [s].[OneToMany_Required_Self_Inverse1Id], [s].[OneToOne_Optional_Self1Id], [s].[Id0], [s].[Date0], [s].[Name0], [s].[OneToMany_Optional_Self_Inverse1Id0], [s].[OneToMany_Required_Self_Inverse1Id0], [s].[OneToOne_Optional_Self1Id0], [l].[Id] FROM [LevelOne] AS [l] -LEFT JOIN [LevelOne] AS [l0] ON [l].[OneToOne_Optional_Self1Id] = [l0].[Id] INNER JOIN ( SELECT [l2].[Id], [l2].[Date], [l2].[Name], [l2].[OneToMany_Optional_Self_Inverse1Id], [l2].[OneToMany_Required_Self_Inverse1Id], [l2].[OneToOne_Optional_Self1Id], [l3].[Id] AS [Id0], [l3].[Date] AS [Date0], [l3].[Name] AS [Name0], [l3].[OneToMany_Optional_Self_Inverse1Id] AS [OneToMany_Optional_Self_Inverse1Id0], [l3].[OneToMany_Required_Self_Inverse1Id] AS [OneToMany_Required_Self_Inverse1Id0], [l3].[OneToOne_Optional_Self1Id] AS [OneToOne_Optional_Self1Id0] FROM [LevelOne] AS [l2] LEFT JOIN [LevelOne] AS [l3] ON [l2].[OneToOne_Optional_Self1Id] = [l3].[Id] ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Self_Inverse1Id] -ORDER BY [l].[Id], [l0].[Id] +ORDER BY [l].[Id] """); } @@ -2630,11 +2629,11 @@ FROM [LevelOne] AS [l0] ) AS [l2] WHERE [l2].[row] <= 1 ) AS [l3] ON [l1].[Name] = [l3].[Name] -ORDER BY [l1].[Name], [l3].[Id] +ORDER BY [l1].[Name] """, // """ -SELECT [l6].[Id], [l6].[Date], [l6].[Level1_Optional_Id], [l6].[Level1_Required_Id], [l6].[Name], [l6].[OneToMany_Optional_Inverse2Id], [l6].[OneToMany_Optional_Self_Inverse2Id], [l6].[OneToMany_Required_Inverse2Id], [l6].[OneToMany_Required_Self_Inverse2Id], [l6].[OneToOne_Optional_PK_Inverse2Id], [l6].[OneToOne_Optional_Self2Id], [l7].[Name], [l9].[Id] +SELECT [l6].[Id], [l6].[Date], [l6].[Level1_Optional_Id], [l6].[Level1_Required_Id], [l6].[Name], [l6].[OneToMany_Optional_Inverse2Id], [l6].[OneToMany_Optional_Self_Inverse2Id], [l6].[OneToMany_Required_Inverse2Id], [l6].[OneToMany_Required_Self_Inverse2Id], [l6].[OneToOne_Optional_PK_Inverse2Id], [l6].[OneToOne_Optional_Self2Id], [l7].[Name] FROM ( SELECT [l].[Name] FROM [LevelOne] AS [l] @@ -2649,7 +2648,7 @@ FROM [LevelOne] AS [l5] WHERE [l8].[row] <= 1 ) AS [l9] ON [l7].[Name] = [l9].[Name] INNER JOIN [LevelTwo] AS [l6] ON [l9].[Id] = [l6].[OneToMany_Optional_Inverse2Id] -ORDER BY [l7].[Name], [l9].[Id] +ORDER BY [l7].[Name] """); } @@ -2675,11 +2674,11 @@ WHERE [l0].[Id] > 3 ) AS [l2] WHERE [l2].[row] <= 1 ) AS [l3] ON [l1].[Name] = [l3].[Name] -ORDER BY [l1].[Name], [l3].[Id] +ORDER BY [l1].[Name] """, // """ -SELECT [l6].[Id], [l6].[Date], [l6].[Level1_Optional_Id], [l6].[Level1_Required_Id], [l6].[Name], [l6].[OneToMany_Optional_Inverse2Id], [l6].[OneToMany_Optional_Self_Inverse2Id], [l6].[OneToMany_Required_Inverse2Id], [l6].[OneToMany_Required_Self_Inverse2Id], [l6].[OneToOne_Optional_PK_Inverse2Id], [l6].[OneToOne_Optional_Self2Id], [l7].[Name], [l9].[Id] +SELECT [l6].[Id], [l6].[Date], [l6].[Level1_Optional_Id], [l6].[Level1_Required_Id], [l6].[Name], [l6].[OneToMany_Optional_Inverse2Id], [l6].[OneToMany_Optional_Self_Inverse2Id], [l6].[OneToMany_Required_Inverse2Id], [l6].[OneToMany_Required_Self_Inverse2Id], [l6].[OneToOne_Optional_PK_Inverse2Id], [l6].[OneToOne_Optional_Self2Id], [l7].[Name] FROM ( SELECT [l].[Name] FROM [LevelOne] AS [l] @@ -2696,7 +2695,7 @@ WHERE [l5].[Id] > 3 WHERE [l8].[row] <= 1 ) AS [l9] ON [l7].[Name] = [l9].[Name] INNER JOIN [LevelTwo] AS [l6] ON [l9].[Id] = [l6].[OneToMany_Optional_Inverse2Id] -ORDER BY [l7].[Name], [l9].[Id] +ORDER BY [l7].[Name] """); } @@ -2721,11 +2720,11 @@ FROM [LevelOne] AS [l0] ) AS [l2] WHERE [l2].[row] <= 1 ) AS [l3] ON [l1].[Name] = [l3].[Name] -ORDER BY [l1].[Name], [l3].[Id] +ORDER BY [l1].[Name] """, // """ -SELECT [l6].[Id], [l6].[Date], [l6].[Level1_Optional_Id], [l6].[Level1_Required_Id], [l6].[Name], [l6].[OneToMany_Optional_Inverse2Id], [l6].[OneToMany_Optional_Self_Inverse2Id], [l6].[OneToMany_Required_Inverse2Id], [l6].[OneToMany_Required_Self_Inverse2Id], [l6].[OneToOne_Optional_PK_Inverse2Id], [l6].[OneToOne_Optional_Self2Id], [l7].[Name], [l9].[Id] +SELECT [l6].[Id], [l6].[Date], [l6].[Level1_Optional_Id], [l6].[Level1_Required_Id], [l6].[Name], [l6].[OneToMany_Optional_Inverse2Id], [l6].[OneToMany_Optional_Self_Inverse2Id], [l6].[OneToMany_Required_Inverse2Id], [l6].[OneToMany_Required_Self_Inverse2Id], [l6].[OneToOne_Optional_PK_Inverse2Id], [l6].[OneToOne_Optional_Self2Id], [l7].[Name] FROM ( SELECT [l].[Name] FROM [LevelOne] AS [l] @@ -2741,7 +2740,7 @@ FROM [LevelOne] AS [l5] WHERE [l8].[row] <= 1 ) AS [l9] ON [l7].[Name] = [l9].[Name] INNER JOIN [LevelTwo] AS [l6] ON [l9].[Id] = [l6].[OneToMany_Optional_Inverse2Id] -ORDER BY [l7].[Name], [l9].[Id] +ORDER BY [l7].[Name] """); } @@ -4107,27 +4106,26 @@ public override async Task Multiple_complex_includes_self_ref_EF_Property(bool a SELECT [l].[Id], [l].[Date], [l].[Name], [l].[OneToMany_Optional_Self_Inverse1Id], [l].[OneToMany_Required_Self_Inverse1Id], [l].[OneToOne_Optional_Self1Id], [l0].[Id], [l0].[Date], [l0].[Name], [l0].[OneToMany_Optional_Self_Inverse1Id], [l0].[OneToMany_Required_Self_Inverse1Id], [l0].[OneToOne_Optional_Self1Id] FROM [LevelOne] AS [l] LEFT JOIN [LevelOne] AS [l0] ON [l].[OneToOne_Optional_Self1Id] = [l0].[Id] -ORDER BY [l].[Id], [l0].[Id] +ORDER BY [l].[Id] """, // """ -SELECT [l1].[Id], [l1].[Date], [l1].[Name], [l1].[OneToMany_Optional_Self_Inverse1Id], [l1].[OneToMany_Required_Self_Inverse1Id], [l1].[OneToOne_Optional_Self1Id], [l].[Id], [l0].[Id] +SELECT [l1].[Id], [l1].[Date], [l1].[Name], [l1].[OneToMany_Optional_Self_Inverse1Id], [l1].[OneToMany_Required_Self_Inverse1Id], [l1].[OneToOne_Optional_Self1Id], [l].[Id] FROM [LevelOne] AS [l] LEFT JOIN [LevelOne] AS [l0] ON [l].[OneToOne_Optional_Self1Id] = [l0].[Id] INNER JOIN [LevelOne] AS [l1] ON [l0].[Id] = [l1].[OneToMany_Optional_Self_Inverse1Id] -ORDER BY [l].[Id], [l0].[Id] +ORDER BY [l].[Id] """, // """ -SELECT [s].[Id], [s].[Date], [s].[Name], [s].[OneToMany_Optional_Self_Inverse1Id], [s].[OneToMany_Required_Self_Inverse1Id], [s].[OneToOne_Optional_Self1Id], [s].[Id0], [s].[Date0], [s].[Name0], [s].[OneToMany_Optional_Self_Inverse1Id0], [s].[OneToMany_Required_Self_Inverse1Id0], [s].[OneToOne_Optional_Self1Id0], [l].[Id], [l0].[Id] +SELECT [s].[Id], [s].[Date], [s].[Name], [s].[OneToMany_Optional_Self_Inverse1Id], [s].[OneToMany_Required_Self_Inverse1Id], [s].[OneToOne_Optional_Self1Id], [s].[Id0], [s].[Date0], [s].[Name0], [s].[OneToMany_Optional_Self_Inverse1Id0], [s].[OneToMany_Required_Self_Inverse1Id0], [s].[OneToOne_Optional_Self1Id0], [l].[Id] FROM [LevelOne] AS [l] -LEFT JOIN [LevelOne] AS [l0] ON [l].[OneToOne_Optional_Self1Id] = [l0].[Id] INNER JOIN ( SELECT [l2].[Id], [l2].[Date], [l2].[Name], [l2].[OneToMany_Optional_Self_Inverse1Id], [l2].[OneToMany_Required_Self_Inverse1Id], [l2].[OneToOne_Optional_Self1Id], [l3].[Id] AS [Id0], [l3].[Date] AS [Date0], [l3].[Name] AS [Name0], [l3].[OneToMany_Optional_Self_Inverse1Id] AS [OneToMany_Optional_Self_Inverse1Id0], [l3].[OneToMany_Required_Self_Inverse1Id] AS [OneToMany_Required_Self_Inverse1Id0], [l3].[OneToOne_Optional_Self1Id] AS [OneToOne_Optional_Self1Id0] FROM [LevelOne] AS [l2] LEFT JOIN [LevelOne] AS [l3] ON [l2].[OneToOne_Optional_Self1Id] = [l3].[Id] ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Self_Inverse1Id] -ORDER BY [l].[Id], [l0].[Id] +ORDER BY [l].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServer160Test.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServer160Test.cs index 4def73b16a3..70478eec932 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServer160Test.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServer160Test.cs @@ -233,7 +233,7 @@ public override async Task Multi_level_include_with_short_circuiting(bool async) AssertSql( """ -SELECT [f].[Name], [f].[LabelDefaultText], [f].[PlaceholderDefaultText], [m].[DefaultText], [m0].[DefaultText], [s].[Text], [s].[ComplexNavigationStringDefaultText], [s].[LanguageName], [s].[Name], [s].[CultureString], [s0].[Text], [s0].[ComplexNavigationStringDefaultText], [s0].[LanguageName], [s0].[Name], [s0].[CultureString] +SELECT [f].[Name], [f].[LabelDefaultText], [f].[PlaceholderDefaultText], [m].[DefaultText], [s].[Text], [s].[ComplexNavigationStringDefaultText], [s].[LanguageName], [s].[Name], [s].[CultureString], [m0].[DefaultText], [s0].[Text], [s0].[ComplexNavigationStringDefaultText], [s0].[LanguageName], [s0].[Name], [s0].[CultureString] FROM [Fields] AS [f] LEFT JOIN [MultilingualStrings] AS [m] ON [f].[LabelDefaultText] = [m].[DefaultText] LEFT JOIN [MultilingualStrings] AS [m0] ON [f].[PlaceholderDefaultText] = [m0].[DefaultText] @@ -247,7 +247,7 @@ LEFT JOIN ( FROM [Globalizations] AS [g0] LEFT JOIN [Languages] AS [l0] ON [g0].[LanguageName] = [l0].[Name] ) AS [s0] ON [m0].[DefaultText] = [s0].[ComplexNavigationStringDefaultText] -ORDER BY [f].[Name], [m].[DefaultText], [m0].[DefaultText], [s].[Text], [s].[Name], [s0].[Text] +ORDER BY [f].[Name], [s].[Text] """); } @@ -2255,7 +2255,6 @@ FROM [LevelOne] AS [l] LEFT JOIN ( SELECT [l0].[Id], [l0].[Level1_Required_Id] FROM [LevelTwo] AS [l0] - LEFT JOIN [LevelOne] AS [l1] ON [l0].[Level1_Required_Id] = [l1].[Id] ) AS [s] ON [l].[Id] = [s].[Level1_Required_Id] """); } @@ -2995,7 +2994,7 @@ FROM [LevelOne] AS [l0] WHERE [s].[row] <= 1 ) AS [s0] ON [l3].[Name] = [s0].[Name] LEFT JOIN [LevelThree] AS [l2] ON [s0].[Id0] = [l2].[OneToMany_Optional_Inverse3Id] -ORDER BY [l3].[Name], [s0].[Id], [s0].[Id0] +ORDER BY [l3].[Name] """); } @@ -4203,7 +4202,7 @@ public override async Task Collection_FirstOrDefault_entity_collection_accesses_ AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse3Id], [l1].[OneToMany_Optional_Self_Inverse3Id], [l1].[OneToMany_Required_Inverse3Id], [l1].[OneToMany_Required_Self_Inverse3Id], [l1].[OneToOne_Optional_PK_Inverse3Id], [l1].[OneToOne_Optional_Self3Id], [l3].[c] +SELECT [l].[Id], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse3Id], [l1].[OneToMany_Optional_Self_Inverse3Id], [l1].[OneToMany_Required_Inverse3Id], [l1].[OneToMany_Required_Self_Inverse3Id], [l1].[OneToOne_Optional_PK_Inverse3Id], [l1].[OneToOne_Optional_Self3Id], [l3].[c] FROM [LevelOne] AS [l] LEFT JOIN ( SELECT [l2].[c], [l2].[Id], [l2].[OneToMany_Optional_Inverse2Id] @@ -4216,7 +4215,7 @@ FROM [LevelTwo] AS [l0] ) AS [l3] ON [l].[Id] = [l3].[OneToMany_Optional_Inverse2Id] LEFT JOIN [LevelThree] AS [l1] ON [l3].[Id] = [l1].[OneToMany_Optional_Inverse3Id] WHERE [l].[Id] < 2 -ORDER BY [l].[Id], [l3].[Id] +ORDER BY [l].[Id] """); } @@ -4782,7 +4781,7 @@ FROM [LevelThree] AS [l] INNER JOIN [LevelOne] AS [l1] ON [l0].[OneToMany_Required_Inverse2Id] = [l1].[Id] LEFT JOIN [LevelFour] AS [l2] ON [l].[Id] = [l2].[OneToMany_Optional_Inverse4Id] WHERE [l1].[Name] = N'L1 01' -ORDER BY [l].[Id], [l0].[Id], [l1].[Id] +ORDER BY [l].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs index 7429e1f9e2f..f81292a1215 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsQuerySqlServerTest.cs @@ -233,7 +233,7 @@ public override async Task Multi_level_include_with_short_circuiting(bool async) AssertSql( """ -SELECT [f].[Name], [f].[LabelDefaultText], [f].[PlaceholderDefaultText], [m].[DefaultText], [m0].[DefaultText], [s].[Text], [s].[ComplexNavigationStringDefaultText], [s].[LanguageName], [s].[Name], [s].[CultureString], [s0].[Text], [s0].[ComplexNavigationStringDefaultText], [s0].[LanguageName], [s0].[Name], [s0].[CultureString] +SELECT [f].[Name], [f].[LabelDefaultText], [f].[PlaceholderDefaultText], [m].[DefaultText], [s].[Text], [s].[ComplexNavigationStringDefaultText], [s].[LanguageName], [s].[Name], [s].[CultureString], [m0].[DefaultText], [s0].[Text], [s0].[ComplexNavigationStringDefaultText], [s0].[LanguageName], [s0].[Name], [s0].[CultureString] FROM [Fields] AS [f] LEFT JOIN [MultilingualStrings] AS [m] ON [f].[LabelDefaultText] = [m].[DefaultText] LEFT JOIN [MultilingualStrings] AS [m0] ON [f].[PlaceholderDefaultText] = [m0].[DefaultText] @@ -247,7 +247,7 @@ LEFT JOIN ( FROM [Globalizations] AS [g0] LEFT JOIN [Languages] AS [l0] ON [g0].[LanguageName] = [l0].[Name] ) AS [s0] ON [m0].[DefaultText] = [s0].[ComplexNavigationStringDefaultText] -ORDER BY [f].[Name], [m].[DefaultText], [m0].[DefaultText], [s].[Text], [s].[Name], [s0].[Text] +ORDER BY [f].[Name], [s].[Text] """); } @@ -2255,7 +2255,6 @@ FROM [LevelOne] AS [l] LEFT JOIN ( SELECT [l0].[Id], [l0].[Level1_Required_Id] FROM [LevelTwo] AS [l0] - LEFT JOIN [LevelOne] AS [l1] ON [l0].[Level1_Required_Id] = [l1].[Id] ) AS [s] ON [l].[Id] = [s].[Level1_Required_Id] """); } @@ -2995,7 +2994,7 @@ FROM [LevelOne] AS [l0] WHERE [s].[row] <= 1 ) AS [s0] ON [l3].[Name] = [s0].[Name] LEFT JOIN [LevelThree] AS [l2] ON [s0].[Id0] = [l2].[OneToMany_Optional_Inverse3Id] -ORDER BY [l3].[Name], [s0].[Id], [s0].[Id0] +ORDER BY [l3].[Name] """); } @@ -4203,7 +4202,7 @@ public override async Task Collection_FirstOrDefault_entity_collection_accesses_ AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse3Id], [l1].[OneToMany_Optional_Self_Inverse3Id], [l1].[OneToMany_Required_Inverse3Id], [l1].[OneToMany_Required_Self_Inverse3Id], [l1].[OneToOne_Optional_PK_Inverse3Id], [l1].[OneToOne_Optional_Self3Id], [l3].[c] +SELECT [l].[Id], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse3Id], [l1].[OneToMany_Optional_Self_Inverse3Id], [l1].[OneToMany_Required_Inverse3Id], [l1].[OneToMany_Required_Self_Inverse3Id], [l1].[OneToOne_Optional_PK_Inverse3Id], [l1].[OneToOne_Optional_Self3Id], [l3].[c] FROM [LevelOne] AS [l] LEFT JOIN ( SELECT [l2].[c], [l2].[Id], [l2].[OneToMany_Optional_Inverse2Id] @@ -4216,7 +4215,7 @@ FROM [LevelTwo] AS [l0] ) AS [l3] ON [l].[Id] = [l3].[OneToMany_Optional_Inverse2Id] LEFT JOIN [LevelThree] AS [l1] ON [l3].[Id] = [l1].[OneToMany_Optional_Inverse3Id] WHERE [l].[Id] < 2 -ORDER BY [l].[Id], [l3].[Id] +ORDER BY [l].[Id] """); } @@ -4782,7 +4781,7 @@ FROM [LevelThree] AS [l] INNER JOIN [LevelOne] AS [l1] ON [l0].[OneToMany_Required_Inverse2Id] = [l1].[Id] LEFT JOIN [LevelFour] AS [l2] ON [l].[Id] = [l2].[OneToMany_Optional_Inverse4Id] WHERE [l1].[Name] = N'L1 01' -ORDER BY [l].[Id], [l0].[Id], [l1].[Id] +ORDER BY [l].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServer160Test.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServer160Test.cs index 15a49e03b72..45824d91669 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServer160Test.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServer160Test.cs @@ -1719,7 +1719,7 @@ public override async Task Collection_FirstOrDefault_entity_collection_accesses_ AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l4].[Id], [l4].[Level2_Optional_Id], [l4].[Level2_Required_Id], [l4].[Level3_Name], [l4].[OneToMany_Optional_Inverse3Id], [l4].[OneToMany_Required_Inverse3Id], [l4].[OneToOne_Optional_PK_Inverse3Id], [l3].[c] +SELECT [l].[Id], [l4].[Id], [l4].[Level2_Optional_Id], [l4].[Level2_Required_Id], [l4].[Level3_Name], [l4].[OneToMany_Optional_Inverse3Id], [l4].[OneToMany_Required_Inverse3Id], [l4].[OneToOne_Optional_PK_Inverse3Id], [l3].[c] FROM [Level1] AS [l] LEFT JOIN ( SELECT [l2].[c], [l2].[Id], [l2].[OneToOne_Required_PK_Date], [l2].[Level1_Required_Id], [l2].[OneToMany_Required_Inverse2Id], [l2].[OneToMany_Optional_Inverse2Id] @@ -1738,7 +1738,7 @@ WHERE [l1].[Level2_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse WHEN [l3].[OneToOne_Required_PK_Date] IS NOT NULL AND [l3].[Level1_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l3].[Id] END = [l4].[OneToMany_Optional_Inverse3Id] WHERE [l].[Id] < 2 -ORDER BY [l].[Id], [l3].[Id] +ORDER BY [l].[Id] """); } @@ -2575,7 +2575,6 @@ WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] ) AS [l2] ON [l0].[Id] = CASE WHEN [l2].[OneToOne_Required_PK_Date] IS NOT NULL AND [l2].[Level1_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l2].[Id] END - LEFT JOIN [Level1] AS [l3] ON [l2].[Level1_Required_Id] = [l3].[Id] WHERE [l2].[OneToOne_Required_PK_Date] IS NOT NULL AND [l2].[Level1_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [s] ON [l].[Id] = [s].[Level1_Required_Id] """); @@ -5647,7 +5646,7 @@ WHERE [l3].[Level2_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse ) AS [l5] ON CASE WHEN [s0].[OneToOne_Required_PK_Date] IS NOT NULL AND [s0].[Level1_Required_Id] IS NOT NULL AND [s0].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [s0].[Id0] END = [l5].[OneToMany_Optional_Inverse3Id] -ORDER BY [l4].[Name], [s0].[Id], [s0].[Id0] +ORDER BY [l4].[Name] """); } @@ -7585,7 +7584,7 @@ public override async Task Multi_level_include_with_short_circuiting(bool async) AssertSql( """ -SELECT [f].[Name], [f].[LabelDefaultText], [f].[PlaceholderDefaultText], [m].[DefaultText], [m0].[DefaultText], [s].[Text], [s].[ComplexNavigationStringDefaultText], [s].[LanguageName], [s].[Name], [s].[CultureString], [s0].[Text], [s0].[ComplexNavigationStringDefaultText], [s0].[LanguageName], [s0].[Name], [s0].[CultureString] +SELECT [f].[Name], [f].[LabelDefaultText], [f].[PlaceholderDefaultText], [m].[DefaultText], [s].[Text], [s].[ComplexNavigationStringDefaultText], [s].[LanguageName], [s].[Name], [s].[CultureString], [m0].[DefaultText], [s0].[Text], [s0].[ComplexNavigationStringDefaultText], [s0].[LanguageName], [s0].[Name], [s0].[CultureString] FROM [Fields] AS [f] LEFT JOIN [MultilingualStrings] AS [m] ON [f].[LabelDefaultText] = [m].[DefaultText] LEFT JOIN [MultilingualStrings] AS [m0] ON [f].[PlaceholderDefaultText] = [m0].[DefaultText] @@ -7599,7 +7598,7 @@ LEFT JOIN ( FROM [Globalizations] AS [g0] LEFT JOIN [Languages] AS [l0] ON [g0].[LanguageName] = [l0].[Name] ) AS [s0] ON [m0].[DefaultText] = [s0].[ComplexNavigationStringDefaultText] -ORDER BY [f].[Name], [m].[DefaultText], [m0].[DefaultText], [s].[Text], [s].[Name], [s0].[Text] +ORDER BY [f].[Name], [s].[Text] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServerTest.cs index c5d550d4cd3..5e770066195 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ComplexNavigationsSharedTypeQuerySqlServerTest.cs @@ -1721,7 +1721,7 @@ public override async Task Collection_FirstOrDefault_entity_collection_accesses_ AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l4].[Id], [l4].[Level2_Optional_Id], [l4].[Level2_Required_Id], [l4].[Level3_Name], [l4].[OneToMany_Optional_Inverse3Id], [l4].[OneToMany_Required_Inverse3Id], [l4].[OneToOne_Optional_PK_Inverse3Id], [l3].[c] +SELECT [l].[Id], [l4].[Id], [l4].[Level2_Optional_Id], [l4].[Level2_Required_Id], [l4].[Level3_Name], [l4].[OneToMany_Optional_Inverse3Id], [l4].[OneToMany_Required_Inverse3Id], [l4].[OneToOne_Optional_PK_Inverse3Id], [l3].[c] FROM [Level1] AS [l] LEFT JOIN ( SELECT [l2].[c], [l2].[Id], [l2].[OneToOne_Required_PK_Date], [l2].[Level1_Required_Id], [l2].[OneToMany_Required_Inverse2Id], [l2].[OneToMany_Optional_Inverse2Id] @@ -1740,7 +1740,7 @@ WHERE [l1].[Level2_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse WHEN [l3].[OneToOne_Required_PK_Date] IS NOT NULL AND [l3].[Level1_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l3].[Id] END = [l4].[OneToMany_Optional_Inverse3Id] WHERE [l].[Id] < 2 -ORDER BY [l].[Id], [l3].[Id] +ORDER BY [l].[Id] """); } @@ -2577,7 +2577,6 @@ WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] ) AS [l2] ON [l0].[Id] = CASE WHEN [l2].[OneToOne_Required_PK_Date] IS NOT NULL AND [l2].[Level1_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l2].[Id] END - LEFT JOIN [Level1] AS [l3] ON [l2].[Level1_Required_Id] = [l3].[Id] WHERE [l2].[OneToOne_Required_PK_Date] IS NOT NULL AND [l2].[Level1_Required_Id] IS NOT NULL AND [l2].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [s] ON [l].[Id] = [s].[Level1_Required_Id] """); @@ -5649,7 +5648,7 @@ WHERE [l3].[Level2_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse ) AS [l5] ON CASE WHEN [s0].[OneToOne_Required_PK_Date] IS NOT NULL AND [s0].[Level1_Required_Id] IS NOT NULL AND [s0].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [s0].[Id0] END = [l5].[OneToMany_Optional_Inverse3Id] -ORDER BY [l4].[Name], [s0].[Id], [s0].[Id0] +ORDER BY [l4].[Name] """); } @@ -7586,7 +7585,7 @@ public override async Task Multi_level_include_with_short_circuiting(bool async) AssertSql( """ -SELECT [f].[Name], [f].[LabelDefaultText], [f].[PlaceholderDefaultText], [m].[DefaultText], [m0].[DefaultText], [s].[Text], [s].[ComplexNavigationStringDefaultText], [s].[LanguageName], [s].[Name], [s].[CultureString], [s0].[Text], [s0].[ComplexNavigationStringDefaultText], [s0].[LanguageName], [s0].[Name], [s0].[CultureString] +SELECT [f].[Name], [f].[LabelDefaultText], [f].[PlaceholderDefaultText], [m].[DefaultText], [s].[Text], [s].[ComplexNavigationStringDefaultText], [s].[LanguageName], [s].[Name], [s].[CultureString], [m0].[DefaultText], [s0].[Text], [s0].[ComplexNavigationStringDefaultText], [s0].[LanguageName], [s0].[Name], [s0].[CultureString] FROM [Fields] AS [f] LEFT JOIN [MultilingualStrings] AS [m] ON [f].[LabelDefaultText] = [m].[DefaultText] LEFT JOIN [MultilingualStrings] AS [m0] ON [f].[PlaceholderDefaultText] = [m0].[DefaultText] @@ -7600,7 +7599,7 @@ LEFT JOIN ( FROM [Globalizations] AS [g0] LEFT JOIN [Languages] AS [l0] ON [g0].[LanguageName] = [l0].[Name] ) AS [s0] ON [m0].[DefaultText] = [s0].[ComplexNavigationStringDefaultText] -ORDER BY [f].[Name], [m].[DefaultText], [m0].[DefaultText], [s].[Text], [s].[Name], [s0].[Text] +ORDER BY [f].[Name], [s].[Text] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs index c389821b466..aac11dfdb09 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Ef6GroupBySqlServerTest.cs @@ -481,14 +481,14 @@ public override async Task Group_Join_from_LINQ_101(bool async) AssertSql( """ -SELECT [c].[Id], [c].[CompanyName], [c].[Region], [s].[Id], [s].[CustomerId], [s].[OrderDate], [s].[Total], [s].[Id0] +SELECT [c].[Id], [c].[CompanyName], [c].[Region], [s].[Id], [s].[CustomerId], [s].[OrderDate], [s].[Total] FROM [CustomerForLinq] AS [c] LEFT JOIN ( SELECT [o].[Id], [o].[CustomerId], [o].[OrderDate], [o].[Total], [c0].[Id] AS [Id0] FROM [OrderForLinq] AS [o] LEFT JOIN [CustomerForLinq] AS [c0] ON [o].[CustomerId] = [c0].[Id] ) AS [s] ON [c].[Id] = [s].[Id0] -ORDER BY [c].[Id], [s].[Id] +ORDER BY [c].[Id] """); } @@ -752,7 +752,7 @@ FROM [Person] AS [p0] WHERE [p2].[row] <= 1 ) AS [p3] ON [p1].[FirstName] = [p3].[FirstName] LEFT JOIN [Shoes] AS [s] ON [p3].[Id] = [s].[PersonId] -ORDER BY [p1].[FirstName], [p3].[Id] +ORDER BY [p1].[FirstName] """); } @@ -854,7 +854,7 @@ public override async Task Left_Outer_Join_with_Group_Join_from_LINQ_101(bool as AssertSql( """ -SELECT [c].[Id], [c].[CompanyName], [c].[Region], [s].[Id], [s].[Id0], [o0].[Id], [o0].[CustomerId], [o0].[OrderDate], [o0].[Total], CASE +SELECT [c].[Id], [c].[CompanyName], [c].[Region], [s].[Id], [o0].[Id], [o0].[CustomerId], [o0].[OrderDate], [o0].[Total], CASE WHEN [s].[Id] IS NULL THEN -1 ELSE [s].[Id] END @@ -865,7 +865,7 @@ FROM [OrderForLinq] AS [o] LEFT JOIN [CustomerForLinq] AS [c0] ON [o].[CustomerId] = [c0].[Id] ) AS [s] ON [c].[Id] = [s].[Id0] LEFT JOIN [OrderForLinq] AS [o0] ON [c].[Id] = [o0].[CustomerId] -ORDER BY [c].[Id], [s].[Id], [s].[Id0] +ORDER BY [c].[Id], [s].[Id] """); } @@ -887,7 +887,7 @@ public override async Task Whats_new_2021_sample_11(bool async) AssertSql( """ -SELECT [p2].[LastName], [p2].[c], [p4].[Id], [p6].[Id], [p6].[Age], [p6].[FirstName], [p6].[LastName], [p6].[MiddleInitial], [p4].[Age], [p4].[FirstName], [p4].[LastName], [p4].[MiddleInitial] +SELECT [p2].[LastName], [p2].[c], [p6].[Id], [p6].[Age], [p6].[FirstName], [p6].[LastName], [p6].[MiddleInitial], [p4].[Id], [p4].[Age], [p4].[FirstName], [p4].[LastName], [p4].[MiddleInitial] FROM ( SELECT [p].[LastName], COUNT(*) AS [c] FROM [Person] AS [p] @@ -909,7 +909,7 @@ FROM [Person] AS [p1] ) AS [p5] WHERE [p5].[row] <= 2 ) AS [p6] ON [p2].[LastName] = [p6].[LastName] -ORDER BY [p2].[LastName] DESC, [p4].[Id], [p6].[LastName], [p6].[Id] +ORDER BY [p2].[LastName] DESC, [p6].[LastName], [p6].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs index 255ab5c7a75..3518ad617e1 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs @@ -42,7 +42,7 @@ public override async Task Include_multiple_one_to_one_and_one_to_many(bool asyn FROM [Tags] AS [t] LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN [Weapons] AS [w] ON [g].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId] +ORDER BY [t].[Id] """); } @@ -69,7 +69,7 @@ public override async Task Include_multiple_circular(bool async) FROM [Gears] AS [g] INNER JOIN [Cities] AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN [Gears] AS [g0] ON [c].[Name] = [g0].[AssignedCityName] -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name], [g0].[Nickname] +ORDER BY [g].[Nickname], [g].[SquadId], [g0].[Nickname] """); } @@ -84,7 +84,7 @@ FROM [Gears] AS [g] INNER JOIN [Cities] AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN [Gears] AS [g0] ON [c].[Name] = [g0].[AssignedCityName] WHERE [g].[Nickname] = N'Marcus' -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name], [g0].[Nickname] +ORDER BY [g].[Nickname], [g].[SquadId], [g0].[Nickname] """); } @@ -193,7 +193,7 @@ public override async Task Include_with_join_collection2(bool async) FROM [Tags] AS [t] INNER JOIN [Gears] AS [g] ON [t].[GearSquadId] = [g].[SquadId] AND [t].[GearNickName] = [g].[Nickname] LEFT JOIN [Weapons] AS [w] ON [g].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId] +ORDER BY [t].[Id] """); } @@ -296,7 +296,7 @@ FROM [Gears] AS [g] INNER JOIN [Tags] AS [t] ON [g].[SquadId] = [t].[GearSquadId] AND [g].[Nickname] = [t].[GearNickName] INNER JOIN [Cities] AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN [Gears] AS [g0] ON [c].[Name] = [g0].[AssignedCityName] -ORDER BY [g].[Nickname], [g].[SquadId], [t].[Id], [c].[Name], [g0].[Nickname] +ORDER BY [g].[Nickname], [g].[SquadId], [t].[Id], [g0].[Nickname] """); } @@ -331,7 +331,7 @@ FROM [Gears] AS [g] WHERE [g].[Discriminator] = N'Officer' ) AS [g0] ON [t].[GearSquadId] = [g0].[SquadId] AND [t].[GearNickName] = [g0].[Nickname] LEFT JOIN [Gears] AS [g1] ON [g0].[Nickname] = [g1].[LeaderNickname] AND [g0].[SquadId] = [g1].[LeaderSquadId] -ORDER BY [g0].[HasSoulPatch], [g0].[Nickname] DESC, [t].[Id], [g0].[SquadId], [g1].[Nickname] +ORDER BY [g0].[HasSoulPatch], [g0].[Nickname] DESC, [t].[Id], [g1].[Nickname] """); } @@ -364,7 +364,7 @@ FROM [Gears] AS [g] WHERE [g].[Discriminator] = N'Officer' ) AS [g0] ON [t].[GearSquadId] = [g0].[SquadId] AND [t].[GearNickName] = [g0].[Nickname] LEFT JOIN [Gears] AS [g1] ON [g0].[Nickname] = [g1].[LeaderNickname] AND [g0].[SquadId] = [g1].[LeaderSquadId] -ORDER BY [t].[Id], [g0].[Nickname], [g0].[SquadId], [g1].[Nickname] +ORDER BY [t].[Id], [g1].[Nickname] """); } @@ -1437,11 +1437,6 @@ FROM [Gears] AS [g] WHERE [g].[HasSoulPatch] = CAST(1 AS bit) AND ( SELECT TOP(1) [w].[IsAutomatic] FROM [Weapons] AS [w] - LEFT JOIN ( - SELECT [w0].[Id] - FROM [Weapons] AS [w0] - WHERE [g].[FullName] = [w0].[OwnerFullName] - ) AS [w1] ON [w].[Id] = [w1].[Id] WHERE [g].[FullName] = [w].[OwnerFullName] ORDER BY [w].[Id]) = CAST(1 AS bit) """); @@ -2266,7 +2261,7 @@ public override async Task Select_correlated_filtered_collection(bool async) AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [c].[Name], [w0].[Id], [w0].[AmmunitionType], [w0].[IsAutomatic], [w0].[Name], [w0].[OwnerFullName], [w0].[SynergyWithId] +SELECT [g].[Nickname], [g].[SquadId], [w0].[Id], [w0].[AmmunitionType], [w0].[IsAutomatic], [w0].[Name], [w0].[OwnerFullName], [w0].[SynergyWithId] FROM [Gears] AS [g] INNER JOIN [Cities] AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN ( @@ -2275,7 +2270,7 @@ FROM [Weapons] AS [w] WHERE [w].[Name] <> N'Lancer' OR [w].[Name] IS NULL ) AS [w0] ON [g].[FullName] = [w0].[OwnerFullName] WHERE [c].[Name] IN (N'Ephyra', N'Hanover') -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -2998,7 +2993,7 @@ FROM [LocustLeaders] AS [l] WHERE [l].[Discriminator] = N'LocustCommander' ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [LocustLeaders] AS [l1] ON [f].[Id] = [l1].[LocustHordeId] -ORDER BY [f].[Name], [f].[Id], [l0].[Name] +ORDER BY [f].[Name], [f].[Id] """); } @@ -3145,7 +3140,7 @@ public override async Task Project_collection_navigation_with_inheritance1(bool AssertSql( """ -SELECT [f].[Id], [l0].[Name], [f0].[Id], [l1].[Name], [l1].[Discriminator], [l1].[LocustHordeId], [l1].[ThreatLevel], [l1].[ThreatLevelByte], [l1].[ThreatLevelNullableByte], [l1].[DefeatedByNickname], [l1].[DefeatedBySquadId], [l1].[HighCommandId] +SELECT [f].[Id], [f0].[Id], [l1].[Name], [l1].[Discriminator], [l1].[LocustHordeId], [l1].[ThreatLevel], [l1].[ThreatLevelByte], [l1].[ThreatLevelNullableByte], [l1].[DefeatedByNickname], [l1].[DefeatedBySquadId], [l1].[HighCommandId] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name] @@ -3154,7 +3149,7 @@ FROM [LocustLeaders] AS [l] ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Factions] AS [f0] ON [l0].[Name] = [f0].[CommanderName] LEFT JOIN [LocustLeaders] AS [l1] ON [f0].[Id] = [l1].[LocustHordeId] -ORDER BY [f].[Id], [l0].[Name], [f0].[Id] +ORDER BY [f].[Id], [f0].[Id] """); } @@ -3164,7 +3159,7 @@ public override async Task Project_collection_navigation_with_inheritance2(bool AssertSql( """ -SELECT [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] +SELECT [f].[Id], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[DefeatedByNickname], [l].[DefeatedBySquadId] @@ -3173,7 +3168,7 @@ FROM [LocustLeaders] AS [l] ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Gears] AS [g] ON [l0].[DefeatedByNickname] = [g].[Nickname] AND [l0].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Gears] AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] -ORDER BY [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [f].[Id], [g0].[Nickname] """); } @@ -3183,7 +3178,7 @@ public override async Task Project_collection_navigation_with_inheritance3(bool AssertSql( """ -SELECT [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] +SELECT [f].[Id], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[DefeatedByNickname], [l].[DefeatedBySquadId] @@ -3192,7 +3187,7 @@ FROM [LocustLeaders] AS [l] ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Gears] AS [g] ON [l0].[DefeatedByNickname] = [g].[Nickname] AND [l0].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Gears] AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] -ORDER BY [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [f].[Id], [g0].[Nickname] """); } @@ -3235,7 +3230,7 @@ LEFT JOIN ( FROM [Gears] AS [g0] INNER JOIN [Cities] AS [c] ON [g0].[CityOfBirthName] = [c].[Name] ) AS [s] ON ([g].[Nickname] = [s].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [s].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [s].[LeaderSquadId] -ORDER BY [l].[Name], [g].[Nickname], [g].[SquadId], [s].[Nickname], [s].[SquadId] +ORDER BY [l].[Name], [s].[Nickname] """); } @@ -3338,7 +3333,7 @@ public override async Task ThenInclude_collection_on_derived_after_base_referenc FROM [Tags] AS [t] LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN [Weapons] AS [w] ON [g].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId] +ORDER BY [t].[Id] """); } @@ -3357,7 +3352,7 @@ FROM [LocustLeaders] AS [l] ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Gears] AS [g] ON [l0].[DefeatedByNickname] = [g].[Nickname] AND [l0].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Gears] AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] -ORDER BY [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [f].[Id], [g0].[Nickname] """); } @@ -3391,7 +3386,7 @@ LEFT JOIN ( FROM [LocustLeaders] AS [l] LEFT JOIN [Gears] AS [g] ON [l].[DefeatedByNickname] = [g].[Nickname] AND [l].[DefeatedBySquadId] = [g].[SquadId] ) AS [s] ON [f].[Id] = [s].[LocustHordeId] -ORDER BY [f].[Id], [s].[Name], [s].[Nickname] +ORDER BY [f].[Id] """); } @@ -3410,7 +3405,7 @@ FROM [LocustLeaders] AS [l] ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Gears] AS [g] ON [l0].[DefeatedByNickname] = [g].[Nickname] AND [l0].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Gears] AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] -ORDER BY [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [f].[Id], [g0].[Nickname] """); } @@ -3428,7 +3423,7 @@ FROM [Gears] AS [g0] INNER JOIN [Squads] AS [s] ON [g0].[SquadId] = [s].[Id] LEFT JOIN [SquadMissions] AS [s0] ON [s].[Id] = [s0].[SquadId] ) AS [s1] ON [g].[Nickname] = [s1].[LeaderNickname] AND [g].[SquadId] = [s1].[LeaderSquadId] -ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[SquadId0] +ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[SquadId0] """); } @@ -3765,7 +3760,7 @@ public override async Task Correlated_collections_projection_of_collection_thru_ AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [s].[Id], [s1].[SquadId], [s1].[MissionId] +SELECT [g].[Nickname], [g].[SquadId], [s1].[SquadId], [s1].[MissionId] FROM [Gears] AS [g] INNER JOIN [Squads] AS [s] ON [g].[SquadId] = [s].[Id] LEFT JOIN ( @@ -3774,7 +3769,7 @@ FROM [SquadMissions] AS [s0] WHERE [s0].[MissionId] <> 17 ) AS [s1] ON [s].[Id] = [s1].[SquadId] WHERE [g].[Nickname] <> N'Marcus' -ORDER BY [g].[FullName], [g].[Nickname], [g].[SquadId], [s].[Id], [s1].[SquadId] +ORDER BY [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[SquadId] """); } @@ -3798,10 +3793,10 @@ public override async Task Correlated_collections_nested(bool async) AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0] FROM [Squads] AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] FROM [SquadMissions] AS [s0] INNER JOIN [Missions] AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -3811,7 +3806,7 @@ WHERE [s1].[SquadId] < 7 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 42 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -3821,10 +3816,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0] FROM [Squads] AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] FROM [SquadMissions] AS [s0] INNER JOIN [Missions] AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -3834,7 +3829,7 @@ WHERE [s1].[SquadId] < 2 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 3 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -3844,10 +3839,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0] FROM [Squads] AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] FROM [SquadMissions] AS [s0] INNER JOIN [Missions] AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -3857,7 +3852,7 @@ WHERE [s1].[SquadId] < 7 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 42 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -3970,7 +3965,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] FROM [Gears] AS [g] LEFT JOIN [Tags] AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] LEFT JOIN [Gears] AS [g1] ON [t].[GearNickName] = [g1].[Nickname] AND [t].[GearSquadId] = [g1].[SquadId] @@ -3983,7 +3978,7 @@ FROM [Weapons] AS [w] SELECT 1 FROM [Gears] AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] """); } @@ -3994,7 +3989,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] FROM [Gears] AS [g] LEFT JOIN [Tags] AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] LEFT JOIN [Gears] AS [g1] ON [t].[GearNickName] = [g1].[Nickname] AND [t].[GearSquadId] = [g1].[SquadId] @@ -4007,7 +4002,7 @@ FROM [Weapons] AS [w] SELECT 1 FROM [Gears] AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] """); } @@ -4018,7 +4013,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] FROM [Gears] AS [g] LEFT JOIN [Tags] AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] LEFT JOIN [Gears] AS [g1] ON [t].[GearNickName] = [g1].[Nickname] AND [t].[GearSquadId] = [g1].[SquadId] @@ -4034,7 +4029,7 @@ FROM [Weapons] AS [w] SELECT 1 FROM [Gears] AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id] DESC, [s].[c], [s].[Nickname] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Id] DESC, [s].[c], [s].[Nickname] """); } @@ -4044,15 +4039,15 @@ public override async Task Correlated_collections_multiple_nested_complex_collec AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Name], [s1].[IsAutomatic], [s1].[Id1], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00], [s2].[Id], [s2].[AmmunitionType], [s2].[IsAutomatic], [s2].[Name], [s2].[OwnerFullName], [s2].[SynergyWithId], [s2].[Nickname], [s2].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Name], [s1].[IsAutomatic], [s1].[Id0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00], [s2].[Id], [s2].[AmmunitionType], [s2].[IsAutomatic], [s2].[Name], [s2].[OwnerFullName], [s2].[SynergyWithId], [s2].[Nickname], [s2].[SquadId] FROM [Gears] AS [g] LEFT JOIN [Tags] AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] LEFT JOIN [Gears] AS [g1] ON [t].[GearNickName] = [g1].[Nickname] AND [t].[GearSquadId] = [g1].[SquadId] LEFT JOIN ( - SELECT [g2].[FullName], [g2].[Nickname], [g2].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Id0], [s0].[Name], [s0].[IsAutomatic], [s0].[Id1], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g2].[Rank], [s0].[IsAutomatic0], [g2].[LeaderNickname], [g2].[LeaderSquadId] + SELECT [g2].[FullName], [g2].[Nickname], [g2].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Name], [s0].[IsAutomatic], [s0].[Id0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g2].[Rank], [s0].[IsAutomatic0], [g2].[LeaderNickname], [g2].[LeaderSquadId] FROM [Gears] AS [g2] LEFT JOIN ( - SELECT [w].[Id], [g3].[Nickname], [g3].[SquadId], [s].[Id] AS [Id0], [w0].[Name], [w0].[IsAutomatic], [w0].[Id] AS [Id1], [g4].[Nickname] AS [Nickname0], [g4].[HasSoulPatch], [g4].[SquadId] AS [SquadId0], [w].[IsAutomatic] AS [IsAutomatic0], [w].[OwnerFullName] + SELECT [w].[Id], [g3].[Nickname], [g3].[SquadId], [w0].[Name], [w0].[IsAutomatic], [w0].[Id] AS [Id0], [g4].[Nickname] AS [Nickname0], [g4].[HasSoulPatch], [g4].[SquadId] AS [SquadId0], [w].[IsAutomatic] AS [IsAutomatic0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN [Gears] AS [g3] ON [w].[OwnerFullName] = [g3].[FullName] LEFT JOIN [Squads] AS [s] ON [g3].[SquadId] = [s].[Id] @@ -4071,7 +4066,7 @@ FROM [Weapons] AS [w1] SELECT 1 FROM [Gears] AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s1].[Rank], [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic0], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Id1], [s1].[Nickname00], [s1].[SquadId00], [s2].[IsAutomatic], [s2].[Nickname] DESC, [s2].[Id] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[Rank], [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic0], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00], [s1].[SquadId00], [s2].[IsAutomatic], [s2].[Nickname] DESC, [s2].[Id] """); } @@ -4327,7 +4322,7 @@ public override async Task Correlated_collections_deeply_nested_left_join(bool a AssertSql( """ -SELECT [t].[Id], [g].[Nickname], [g].[SquadId], [s].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[SynergyWithId] +SELECT [t].[Id], [g].[Nickname], [g].[SquadId], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[SynergyWithId] FROM [Tags] AS [t] LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] LEFT JOIN [Squads] AS [s] ON [g].[SquadId] = [s].[Id] @@ -4341,7 +4336,7 @@ FROM [Weapons] AS [w] ) AS [w0] ON [g0].[FullName] = [w0].[OwnerFullName] WHERE [g0].[HasSoulPatch] = CAST(1 AS bit) ) AS [s0] ON [s].[Id] = [s0].[SquadId] -ORDER BY [t].[Note], [g].[Nickname] DESC, [t].[Id], [g].[SquadId], [s].[Id], [s0].[Nickname], [s0].[SquadId] +ORDER BY [t].[Note], [g].[Nickname] DESC, [t].[Id], [g].[SquadId], [s0].[Nickname], [s0].[SquadId] """); } @@ -4351,7 +4346,7 @@ public override async Task Correlated_collections_from_left_join_with_additional AssertSql( """ -SELECT [w].[Id], [g].[Nickname], [g].[SquadId], [s].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[SynergyWithId], [s0].[Rank] +SELECT [w].[Id], [g].[Nickname], [g].[SquadId], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[SynergyWithId], [s0].[Rank] FROM [Weapons] AS [w] LEFT JOIN [Gears] AS [g] ON [w].[OwnerFullName] = [g].[FullName] LEFT JOIN [Squads] AS [s] ON [g].[SquadId] = [s].[Id] @@ -4364,7 +4359,7 @@ FROM [Weapons] AS [w0] WHERE [w0].[IsAutomatic] = CAST(0 AS bit) ) AS [w1] ON [g0].[FullName] = [w1].[OwnerFullName] ) AS [s0] ON [s].[Id] = [s0].[SquadId] -ORDER BY [w].[Name], [w].[Id], [g].[Nickname], [g].[SquadId], [s].[Id], [s0].[FullName] DESC, [s0].[Nickname], [s0].[SquadId], [s0].[Id] +ORDER BY [w].[Name], [w].[Id], [g].[Nickname], [g].[SquadId], [s0].[FullName] DESC, [s0].[Nickname], [s0].[SquadId], [s0].[Id] """); } @@ -4374,16 +4369,16 @@ public override async Task Correlated_collections_complex_scenario1(bool async) AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] FROM [Gears] AS [g] LEFT JOIN ( - SELECT [w].[Id], [g0].[Nickname], [g0].[SquadId], [s].[Id] AS [Id0], [g1].[Nickname] AS [Nickname0], [g1].[HasSoulPatch], [g1].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [g0].[Nickname], [g0].[SquadId], [g1].[Nickname] AS [Nickname0], [g1].[HasSoulPatch], [g1].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN [Gears] AS [g0] ON [w].[OwnerFullName] = [g0].[FullName] LEFT JOIN [Squads] AS [s] ON [g0].[SquadId] = [s].[Id] LEFT JOIN [Gears] AS [g1] ON [s].[Id] = [g1].[SquadId] ) AS [s0] ON [g].[FullName] = [s0].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0] +ORDER BY [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0] """); } @@ -4393,13 +4388,13 @@ public override async Task Correlated_collections_complex_scenario2(bool async) AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] FROM [Gears] AS [g] LEFT JOIN ( - SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Id0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g0].[LeaderNickname], [g0].[LeaderSquadId] + SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g0].[LeaderNickname], [g0].[LeaderSquadId] FROM [Gears] AS [g0] LEFT JOIN ( - SELECT [w].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id] AS [Id0], [g2].[Nickname] AS [Nickname0], [g2].[HasSoulPatch], [g2].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [g1].[Nickname], [g1].[SquadId], [g2].[Nickname] AS [Nickname0], [g2].[HasSoulPatch], [g2].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN [Gears] AS [g1] ON [w].[OwnerFullName] = [g1].[FullName] LEFT JOIN [Squads] AS [s] ON [g1].[SquadId] = [s].[Id] @@ -4407,7 +4402,7 @@ FROM [Weapons] AS [w] ) AS [s0] ON [g0].[FullName] = [s0].[OwnerFullName] ) AS [s1] ON [g].[Nickname] = [s1].[LeaderNickname] AND [g].[SquadId] = [s1].[LeaderSquadId] WHERE [g].[Discriminator] = N'Officer' -ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00] +ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00] """); } @@ -4417,16 +4412,16 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] FROM [Gears] AS [g] LEFT JOIN ( - SELECT [w].[Id], [g0].[Nickname], [g0].[SquadId], [s].[Id] AS [Id0], [g1].[Nickname] AS [Nickname0], [g1].[HasSoulPatch], [g1].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [g0].[Nickname], [g0].[SquadId], [g1].[Nickname] AS [Nickname0], [g1].[HasSoulPatch], [g1].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN [Gears] AS [g0] ON [w].[OwnerFullName] = [g0].[FullName] LEFT JOIN [Squads] AS [s] ON [g0].[SquadId] = [s].[Id] LEFT JOIN [Gears] AS [g1] ON [s].[Id] = [g1].[SquadId] ) AS [s0] ON [g].[FullName] = [s0].[OwnerFullName] -ORDER BY [g].[FullName], [g].[Nickname] DESC, [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0] +ORDER BY [g].[FullName], [g].[Nickname] DESC, [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0] """); } @@ -4436,13 +4431,13 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] FROM [Gears] AS [g] LEFT JOIN ( - SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Id0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g0].[HasSoulPatch] AS [HasSoulPatch0], [s0].[IsAutomatic], [s0].[Name], [g0].[LeaderNickname], [g0].[LeaderSquadId] + SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g0].[HasSoulPatch] AS [HasSoulPatch0], [s0].[IsAutomatic], [s0].[Name], [g0].[LeaderNickname], [g0].[LeaderSquadId] FROM [Gears] AS [g0] LEFT JOIN ( - SELECT [w].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id] AS [Id0], [g2].[Nickname] AS [Nickname0], [g2].[HasSoulPatch], [g2].[SquadId] AS [SquadId0], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName] + SELECT [w].[Id], [g1].[Nickname], [g1].[SquadId], [g2].[Nickname] AS [Nickname0], [g2].[HasSoulPatch], [g2].[SquadId] AS [SquadId0], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN [Gears] AS [g1] ON [w].[OwnerFullName] = [g1].[FullName] LEFT JOIN [Squads] AS [s] ON [g1].[SquadId] = [s].[Id] @@ -4450,7 +4445,7 @@ FROM [Weapons] AS [w] ) AS [s0] ON [g0].[FullName] = [s0].[OwnerFullName] ) AS [s1] ON [g].[Nickname] = [s1].[LeaderNickname] AND [g].[SquadId] = [s1].[LeaderSquadId] WHERE [g].[Discriminator] = N'Officer' -ORDER BY [g].[HasSoulPatch], [g].[LeaderNickname], [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[HasSoulPatch0] DESC, [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic], [s1].[Name] DESC, [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00] +ORDER BY [g].[HasSoulPatch], [g].[LeaderNickname], [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[HasSoulPatch0] DESC, [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic], [s1].[Name] DESC, [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00] """); } @@ -4567,7 +4562,7 @@ LEFT JOIN [Tags] AS [t] ON ([g].[Nickname] = [t].[GearNickName] OR ([g].[Nicknam ORDER BY [t].[Note] ) AS [s] LEFT JOIN [Weapons] AS [w] ON [s].[FullName] = [w].[OwnerFullName] -ORDER BY [s].[Note], [s].[Name], [s].[Nickname], [s].[SquadId], [s].[Id] +ORDER BY [s].[Note], [s].[Name], [s].[Id] """); } @@ -5732,7 +5727,7 @@ GROUP BY [g].[Rank] LEFT JOIN ( SELECT [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[Discriminator], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[Rank], [s].[Name], [s].[Location], [s].[Nation] FROM ( - SELECT [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank], [c].[Name], [c].[Location], [c].[Nation], ROW_NUMBER() OVER(PARTITION BY [g0].[Rank] ORDER BY [g0].[Nickname], [g0].[SquadId], [c].[Name]) AS [row] + SELECT [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank], [c].[Name], [c].[Location], [c].[Nation], ROW_NUMBER() OVER(PARTITION BY [g0].[Rank] ORDER BY [g0].[Nickname], [g0].[SquadId]) AS [row] FROM [Gears] AS [g0] INNER JOIN [Cities] AS [c] ON [g0].[CityOfBirthName] = [c].[Name] WHERE [g0].[HasSoulPatch] = CAST(1 AS bit) @@ -6200,7 +6195,7 @@ public override async Task Project_collection_navigation_nested_with_take_compos AssertSql( """ -SELECT [t].[Id], [g].[Nickname], [g].[SquadId], [g2].[Nickname], [g2].[SquadId], [g2].[AssignedCityName], [g2].[CityOfBirthName], [g2].[Discriminator], [g2].[FullName], [g2].[HasSoulPatch], [g2].[LeaderNickname], [g2].[LeaderSquadId], [g2].[Rank] +SELECT [t].[Id], [g2].[Nickname], [g2].[SquadId], [g2].[AssignedCityName], [g2].[CityOfBirthName], [g2].[Discriminator], [g2].[FullName], [g2].[HasSoulPatch], [g2].[LeaderNickname], [g2].[LeaderSquadId], [g2].[Rank] FROM [Tags] AS [t] LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN ( @@ -6212,7 +6207,7 @@ FROM [Gears] AS [g0] WHERE [g1].[row] <= 50 ) AS [g2] ON ([g].[Nickname] = [g2].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g2].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g2].[LeaderSquadId] WHERE [g].[Discriminator] = N'Officer' -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId], [g2].[Nickname] +ORDER BY [t].[Id], [g2].[Nickname] """); } @@ -6222,12 +6217,12 @@ public override async Task Project_collection_navigation_nested_composite_key(bo AssertSql( """ -SELECT [t].[Id], [g].[Nickname], [g].[SquadId], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] +SELECT [t].[Id], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] FROM [Tags] AS [t] LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN [Gears] AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] WHERE [g].[Discriminator] = N'Officer' -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [t].[Id], [g0].[Nickname] """); } @@ -6564,14 +6559,14 @@ public override async Task Accessing_reference_navigation_collection_composition AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [s].[Id], [s].[IsAutomatic], [s].[Name], [s].[Id0] +SELECT [g].[Nickname], [g].[SquadId], [s].[Id], [s].[IsAutomatic], [s].[Name] FROM [Gears] AS [g] LEFT JOIN ( - SELECT [w].[Id], [w].[IsAutomatic], [w0].[Name], [w0].[Id] AS [Id0], [w].[OwnerFullName] + SELECT [w].[Id], [w].[IsAutomatic], [w0].[Name], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN [Weapons] AS [w0] ON [w].[SynergyWithId] = [w0].[Id] ) AS [s] ON [g].[FullName] = [s].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [s].[Id] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -6598,7 +6593,7 @@ public override async Task Accessing_property_of_optional_navigation_in_child_pr SELECT CASE WHEN [g].[Nickname] IS NOT NULL AND [g].[SquadId] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) -END, [t].[Id], [g].[Nickname], [g].[SquadId], [s].[Nickname], [s].[Id], [s].[SquadId] +END, [t].[Id], [s].[Nickname], [s].[Id], [s].[SquadId] FROM [Tags] AS [t] LEFT JOIN [Gears] AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN ( @@ -6606,7 +6601,7 @@ LEFT JOIN ( FROM [Weapons] AS [w] LEFT JOIN [Gears] AS [g0] ON [w].[OwnerFullName] = [g0].[FullName] ) AS [s] ON [g].[FullName] = [s].[OwnerFullName] -ORDER BY [t].[Note], [t].[Id], [g].[Nickname], [g].[SquadId], [s].[Id], [s].[Nickname] +ORDER BY [t].[Note], [t].[Id], [s].[Id], [s].[Nickname] """); } @@ -7720,7 +7715,7 @@ public override async Task Correlated_collection_take(bool async) AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [c].[Name], [w1].[Id], [w1].[AmmunitionType], [w1].[IsAutomatic], [w1].[Name], [w1].[OwnerFullName], [w1].[SynergyWithId], [c].[Location], [c].[Nation] +SELECT [g].[Nickname], [g].[SquadId], [w1].[Id], [w1].[AmmunitionType], [w1].[IsAutomatic], [w1].[Name], [w1].[OwnerFullName], [w1].[SynergyWithId], [c].[Name], [c].[Location], [c].[Nation] FROM [Gears] AS [g] INNER JOIN [Cities] AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN ( @@ -7731,7 +7726,7 @@ FROM [Weapons] AS [w] ) AS [w0] WHERE [w0].[row] <= 10 ) AS [w1] ON [g].[FullName] = [w1].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -8568,7 +8563,7 @@ FROM [LocustLeaders] AS [l] LEFT JOIN [Gears] AS [g] ON [l].[DefeatedByNickname] = [g].[Nickname] AND [l].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Weapons] AS [w] ON [g].[FullName] = [w].[OwnerFullName] WHERE [l].[Name] LIKE N'%Queen%' -ORDER BY [l].[Name], [g].[Nickname], [g].[SquadId] +ORDER BY [l].[Name] """); } @@ -8627,7 +8622,7 @@ FROM [Weapons] AS [w0] ) AS [w1] WHERE [w1].[row] <= 1 ) AS [w2] ON [g].[FullName] = [w2].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [s].[Id] +ORDER BY [g].[Nickname], [g].[SquadId] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCGearsOfWarQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCGearsOfWarQuerySqlServerTest.cs index da1f9dcabb9..464502570fd 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCGearsOfWarQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCGearsOfWarQuerySqlServerTest.cs @@ -65,7 +65,7 @@ UNION ALL FROM [Officers] AS [o] ) AS [u] ON [t].[GearNickName] = [u].[Nickname] AND [t].[GearSquadId] = [u].[SquadId] LEFT JOIN [Weapons] AS [w] ON [u].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [u].[Nickname], [u].[SquadId] +ORDER BY [t].[Id] """); } @@ -110,7 +110,7 @@ UNION ALL SELECT [o0].[Nickname], [o0].[SquadId], [o0].[AssignedCityName], [o0].[CityOfBirthName], [o0].[FullName], [o0].[HasSoulPatch], [o0].[LeaderNickname], [o0].[LeaderSquadId], [o0].[Rank], N'Officer' AS [Discriminator] FROM [Officers] AS [o0] ) AS [u0] ON [c].[Name] = [u0].[AssignedCityName] -ORDER BY [u].[Nickname], [u].[SquadId], [c].[Name], [u0].[Nickname] +ORDER BY [u].[Nickname], [u].[SquadId], [u0].[Nickname] """); } @@ -137,7 +137,7 @@ UNION ALL FROM [Officers] AS [o0] ) AS [u0] ON [c].[Name] = [u0].[AssignedCityName] WHERE [u].[Nickname] = N'Marcus' -ORDER BY [u].[Nickname], [u].[SquadId], [c].[Name], [u0].[Nickname] +ORDER BY [u].[Nickname], [u].[SquadId], [u0].[Nickname] """); } @@ -298,7 +298,7 @@ UNION ALL FROM [Officers] AS [o] ) AS [u] ON [t].[GearSquadId] = [u].[SquadId] AND [t].[GearNickName] = [u].[Nickname] LEFT JOIN [Weapons] AS [w] ON [u].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [u].[Nickname], [u].[SquadId] +ORDER BY [t].[Id] """); } @@ -431,7 +431,7 @@ UNION ALL SELECT [o0].[Nickname], [o0].[SquadId], [o0].[AssignedCityName], [o0].[CityOfBirthName], [o0].[FullName], [o0].[HasSoulPatch], [o0].[LeaderNickname], [o0].[LeaderSquadId], [o0].[Rank], N'Officer' AS [Discriminator] FROM [Officers] AS [o0] ) AS [u0] ON [c].[Name] = [u0].[AssignedCityName] -ORDER BY [u].[Nickname], [u].[SquadId], [t].[Id], [c].[Name], [u0].[Nickname] +ORDER BY [u].[Nickname], [u].[SquadId], [t].[Id], [u0].[Nickname] """); } @@ -470,7 +470,7 @@ UNION ALL SELECT [o0].[Nickname], [o0].[SquadId], [o0].[AssignedCityName], [o0].[CityOfBirthName], [o0].[FullName], [o0].[HasSoulPatch], [o0].[LeaderNickname], [o0].[LeaderSquadId], [o0].[Rank], N'Officer' AS [Discriminator] FROM [Officers] AS [o0] ) AS [u0] ON [u].[Nickname] = [u0].[LeaderNickname] AND [u].[SquadId] = [u0].[LeaderSquadId] -ORDER BY [u].[HasSoulPatch], [u].[Nickname] DESC, [t].[Id], [u].[SquadId], [u0].[Nickname] +ORDER BY [u].[HasSoulPatch], [u].[Nickname] DESC, [t].[Id], [u0].[Nickname] """); } @@ -510,7 +510,7 @@ UNION ALL SELECT [o0].[Nickname], [o0].[SquadId], [o0].[AssignedCityName], [o0].[CityOfBirthName], [o0].[FullName], [o0].[HasSoulPatch], [o0].[LeaderNickname], [o0].[LeaderSquadId], [o0].[Rank], N'Officer' AS [Discriminator] FROM [Officers] AS [o0] ) AS [u0] ON [u].[Nickname] = [u0].[LeaderNickname] AND [u].[SquadId] = [u0].[LeaderSquadId] -ORDER BY [t].[Id], [u].[Nickname], [u].[SquadId], [u0].[Nickname] +ORDER BY [t].[Id], [u0].[Nickname] """); } @@ -1963,11 +1963,6 @@ FROM [Officers] AS [o] WHERE [u].[HasSoulPatch] = CAST(1 AS bit) AND ( SELECT TOP(1) [w].[IsAutomatic] FROM [Weapons] AS [w] - LEFT JOIN ( - SELECT [w0].[Id] - FROM [Weapons] AS [w0] - WHERE [u].[FullName] = [w0].[OwnerFullName] - ) AS [w1] ON [w].[Id] = [w1].[Id] WHERE [u].[FullName] = [w].[OwnerFullName] ORDER BY [w].[Id]) = CAST(1 AS bit) """); @@ -3121,7 +3116,7 @@ public override async Task Select_correlated_filtered_collection(bool async) AssertSql( """ -SELECT [u].[Nickname], [u].[SquadId], [c].[Name], [w0].[Id], [w0].[AmmunitionType], [w0].[IsAutomatic], [w0].[Name], [w0].[OwnerFullName], [w0].[SynergyWithId] +SELECT [u].[Nickname], [u].[SquadId], [w0].[Id], [w0].[AmmunitionType], [w0].[IsAutomatic], [w0].[Name], [w0].[OwnerFullName], [w0].[SynergyWithId] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[CityOfBirthName], [g].[FullName] FROM [Gears] AS [g] @@ -3136,7 +3131,7 @@ FROM [Weapons] AS [w] WHERE [w].[Name] <> N'Lancer' OR [w].[Name] IS NULL ) AS [w0] ON [u].[FullName] = [w0].[OwnerFullName] WHERE [c].[Name] IN (N'Ephyra', N'Hanover') -ORDER BY [u].[Nickname], [u].[SquadId], [c].[Name] +ORDER BY [u].[Nickname], [u].[SquadId] """); } @@ -3985,7 +3980,7 @@ UNION ALL SELECT [l2].[Name], [l2].[LocustHordeId], [l2].[ThreatLevel], [l2].[ThreatLevelByte], [l2].[ThreatLevelNullableByte], [l2].[DefeatedByNickname], [l2].[DefeatedBySquadId], [l2].[HighCommandId], N'LocustCommander' AS [Discriminator] FROM [LocustCommanders] AS [l2] ) AS [u] ON [l].[Id] = [u].[LocustHordeId] -ORDER BY [l].[Name], [l].[Id], [l0].[Name] +ORDER BY [l].[Name], [l].[Id] """); } @@ -4174,7 +4169,7 @@ public override async Task Project_collection_navigation_with_inheritance1(bool AssertSql( """ -SELECT [l].[Id], [l0].[Name], [l1].[Id], [u].[Name], [u].[LocustHordeId], [u].[ThreatLevel], [u].[ThreatLevelByte], [u].[ThreatLevelNullableByte], [u].[DefeatedByNickname], [u].[DefeatedBySquadId], [u].[HighCommandId], [u].[Discriminator] +SELECT [l].[Id], [l1].[Id], [u].[Name], [u].[LocustHordeId], [u].[ThreatLevel], [u].[ThreatLevelByte], [u].[ThreatLevelNullableByte], [u].[DefeatedByNickname], [u].[DefeatedBySquadId], [u].[HighCommandId], [u].[Discriminator] FROM [LocustHordes] AS [l] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] LEFT JOIN [LocustHordes] AS [l1] ON [l0].[Name] = [l1].[CommanderName] @@ -4185,7 +4180,7 @@ UNION ALL SELECT [l3].[Name], [l3].[LocustHordeId], [l3].[ThreatLevel], [l3].[ThreatLevelByte], [l3].[ThreatLevelNullableByte], [l3].[DefeatedByNickname], [l3].[DefeatedBySquadId], [l3].[HighCommandId], N'LocustCommander' AS [Discriminator] FROM [LocustCommanders] AS [l3] ) AS [u] ON [l1].[Id] = [u].[LocustHordeId] -ORDER BY [l].[Id], [l0].[Name], [l1].[Id] +ORDER BY [l].[Id], [l1].[Id] """); } @@ -4195,7 +4190,7 @@ public override async Task Project_collection_navigation_with_inheritance2(bool AssertSql( """ -SELECT [l].[Id], [l0].[Name], [u].[Nickname], [u].[SquadId], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] +SELECT [l].[Id], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] FROM [LocustHordes] AS [l] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] LEFT JOIN ( @@ -4212,7 +4207,7 @@ UNION ALL SELECT [o0].[Nickname], [o0].[SquadId], [o0].[AssignedCityName], [o0].[CityOfBirthName], [o0].[FullName], [o0].[HasSoulPatch], [o0].[LeaderNickname], [o0].[LeaderSquadId], [o0].[Rank], N'Officer' AS [Discriminator] FROM [Officers] AS [o0] ) AS [u0] ON ([u].[Nickname] = [u0].[LeaderNickname] OR ([u].[Nickname] IS NULL AND [u0].[LeaderNickname] IS NULL)) AND [u].[SquadId] = [u0].[LeaderSquadId] -ORDER BY [l].[Id], [l0].[Name], [u].[Nickname], [u].[SquadId], [u0].[Nickname] +ORDER BY [l].[Id], [u0].[Nickname] """); } @@ -4222,7 +4217,7 @@ public override async Task Project_collection_navigation_with_inheritance3(bool AssertSql( """ -SELECT [l].[Id], [l0].[Name], [u].[Nickname], [u].[SquadId], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] +SELECT [l].[Id], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] FROM [LocustHordes] AS [l] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] LEFT JOIN ( @@ -4239,7 +4234,7 @@ UNION ALL SELECT [o0].[Nickname], [o0].[SquadId], [o0].[AssignedCityName], [o0].[CityOfBirthName], [o0].[FullName], [o0].[HasSoulPatch], [o0].[LeaderNickname], [o0].[LeaderSquadId], [o0].[Rank], N'Officer' AS [Discriminator] FROM [Officers] AS [o0] ) AS [u0] ON ([u].[Nickname] = [u0].[LeaderNickname] OR ([u].[Nickname] IS NULL AND [u0].[LeaderNickname] IS NULL)) AND [u].[SquadId] = [u0].[LeaderSquadId] -ORDER BY [l].[Id], [l0].[Name], [u].[Nickname], [u].[SquadId], [u0].[Nickname] +ORDER BY [l].[Id], [u0].[Nickname] """); } @@ -4324,7 +4319,7 @@ FROM [Officers] AS [o0] ) AS [u1] INNER JOIN [Cities] AS [c] ON [u1].[CityOfBirthName] = [c].[Name] ) AS [s] ON ([u0].[Nickname] = [s].[LeaderNickname] OR ([u0].[Nickname] IS NULL AND [s].[LeaderNickname] IS NULL)) AND [u0].[SquadId] = [s].[LeaderSquadId] -ORDER BY [u].[Name], [u0].[Nickname], [u0].[SquadId], [s].[Nickname], [s].[SquadId] +ORDER BY [u].[Name], [s].[Nickname] """); } @@ -4511,7 +4506,7 @@ UNION ALL FROM [Officers] AS [o] ) AS [u] ON [t].[GearNickName] = [u].[Nickname] AND [t].[GearSquadId] = [u].[SquadId] LEFT JOIN [Weapons] AS [w] ON [u].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [u].[Nickname], [u].[SquadId] +ORDER BY [t].[Id] """); } @@ -4538,7 +4533,7 @@ UNION ALL SELECT [o0].[Nickname], [o0].[SquadId], [o0].[AssignedCityName], [o0].[CityOfBirthName], [o0].[FullName], [o0].[HasSoulPatch], [o0].[LeaderNickname], [o0].[LeaderSquadId], [o0].[Rank], N'Officer' AS [Discriminator] FROM [Officers] AS [o0] ) AS [u0] ON ([u].[Nickname] = [u0].[LeaderNickname] OR ([u].[Nickname] IS NULL AND [u0].[LeaderNickname] IS NULL)) AND [u].[SquadId] = [u0].[LeaderSquadId] -ORDER BY [l].[Id], [l0].[Name], [u].[Nickname], [u].[SquadId], [u0].[Nickname] +ORDER BY [l].[Id], [u0].[Nickname] """); } @@ -4602,7 +4597,7 @@ UNION ALL FROM [Officers] AS [o] ) AS [u0] ON [u].[DefeatedByNickname] = [u0].[Nickname] AND [u].[DefeatedBySquadId] = [u0].[SquadId] ) AS [s] ON [l].[Id] = [s].[LocustHordeId] -ORDER BY [l].[Id], [s].[Name], [s].[Nickname] +ORDER BY [l].[Id] """); } @@ -4629,7 +4624,7 @@ UNION ALL SELECT [o0].[Nickname], [o0].[SquadId], [o0].[AssignedCityName], [o0].[CityOfBirthName], [o0].[FullName], [o0].[HasSoulPatch], [o0].[LeaderNickname], [o0].[LeaderSquadId], [o0].[Rank], N'Officer' AS [Discriminator] FROM [Officers] AS [o0] ) AS [u0] ON ([u].[Nickname] = [u0].[LeaderNickname] OR ([u].[Nickname] IS NULL AND [u0].[LeaderNickname] IS NULL)) AND [u].[SquadId] = [u0].[LeaderSquadId] -ORDER BY [l].[Id], [l0].[Name], [u].[Nickname], [u].[SquadId], [u0].[Nickname] +ORDER BY [l].[Id], [u0].[Nickname] """); } @@ -4659,7 +4654,7 @@ FROM [Officers] AS [o0] INNER JOIN [Squads] AS [s] ON [u0].[SquadId] = [s].[Id] LEFT JOIN [SquadMissions] AS [s0] ON [s].[Id] = [s0].[SquadId] ) AS [s1] ON [u].[Nickname] = [s1].[LeaderNickname] AND [u].[SquadId] = [s1].[LeaderSquadId] -ORDER BY [u].[Nickname], [u].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[SquadId0] +ORDER BY [u].[Nickname], [u].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[SquadId0] """); } @@ -5018,7 +5013,7 @@ public override async Task Correlated_collections_projection_of_collection_thru_ AssertSql( """ -SELECT [u].[Nickname], [u].[SquadId], [s].[Id], [s1].[SquadId], [s1].[MissionId] +SELECT [u].[Nickname], [u].[SquadId], [s1].[SquadId], [s1].[MissionId] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName] FROM [Gears] AS [g] @@ -5033,7 +5028,7 @@ FROM [SquadMissions] AS [s0] WHERE [s0].[MissionId] <> 17 ) AS [s1] ON [s].[Id] = [s1].[SquadId] WHERE [u].[Nickname] <> N'Marcus' -ORDER BY [u].[FullName], [u].[Nickname], [u].[SquadId], [s].[Id], [s1].[SquadId] +ORDER BY [u].[FullName], [u].[Nickname], [u].[SquadId], [s1].[SquadId] """); } @@ -5063,10 +5058,10 @@ public override async Task Correlated_collections_nested(bool async) AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0] FROM [Squads] AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] FROM [SquadMissions] AS [s0] INNER JOIN [Missions] AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -5076,7 +5071,7 @@ WHERE [s1].[SquadId] < 7 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 42 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -5086,10 +5081,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0] FROM [Squads] AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] FROM [SquadMissions] AS [s0] INNER JOIN [Missions] AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -5099,7 +5094,7 @@ WHERE [s1].[SquadId] < 2 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 3 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -5109,10 +5104,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0] FROM [Squads] AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] FROM [SquadMissions] AS [s0] INNER JOIN [Missions] AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -5122,7 +5117,7 @@ WHERE [s1].[SquadId] < 7 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 42 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -5272,7 +5267,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [t].[Id], [u1].[Nickname], [u1].[SquadId], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] +SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [t].[Id], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] FROM ( SELECT [o].[Nickname], [o].[SquadId], [o].[FullName], [o].[HasSoulPatch] FROM [Officers] AS [o] @@ -5306,7 +5301,7 @@ UNION ALL FROM [Officers] AS [o0] ) AS [u0] WHERE [u].[Nickname] = [u0].[LeaderNickname] AND [u].[SquadId] = [u0].[LeaderSquadId]) -ORDER BY [u].[HasSoulPatch] DESC, [t].[Note], [u].[Nickname], [u].[SquadId], [t].[Id], [u1].[Nickname], [u1].[SquadId], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] +ORDER BY [u].[HasSoulPatch] DESC, [t].[Note], [u].[Nickname], [u].[SquadId], [t].[Id], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] """); } @@ -5317,7 +5312,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [t].[Id], [u1].[Nickname], [u1].[SquadId], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] +SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [t].[Id], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] FROM ( SELECT [o].[Nickname], [o].[SquadId], [o].[FullName], [o].[HasSoulPatch] FROM [Officers] AS [o] @@ -5351,7 +5346,7 @@ UNION ALL FROM [Officers] AS [o0] ) AS [u0] WHERE [u].[Nickname] = [u0].[LeaderNickname] AND [u].[SquadId] = [u0].[LeaderSquadId]) -ORDER BY [u].[HasSoulPatch] DESC, [t].[Note], [u].[Nickname], [u].[SquadId], [t].[Id], [u1].[Nickname], [u1].[SquadId], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] +ORDER BY [u].[HasSoulPatch] DESC, [t].[Note], [u].[Nickname], [u].[SquadId], [t].[Id], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] """); } @@ -5362,7 +5357,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [t].[Id], [u1].[Nickname], [u1].[SquadId], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] +SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [t].[Id], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] FROM ( SELECT [o].[Nickname], [o].[SquadId], [o].[FullName], [o].[HasSoulPatch] FROM [Officers] AS [o] @@ -5399,7 +5394,7 @@ UNION ALL FROM [Officers] AS [o0] ) AS [u0] WHERE [u].[Nickname] = [u0].[LeaderNickname] AND [u].[SquadId] = [u0].[LeaderSquadId]) -ORDER BY [u].[HasSoulPatch] DESC, [t].[Note], [u].[Nickname], [u].[SquadId], [t].[Id], [u1].[Nickname], [u1].[SquadId], [s].[Id] DESC, [s].[c], [s].[Nickname] +ORDER BY [u].[HasSoulPatch] DESC, [t].[Note], [u].[Nickname], [u].[SquadId], [t].[Id], [s].[Id] DESC, [s].[c], [s].[Nickname] """); } @@ -5409,7 +5404,7 @@ public override async Task Correlated_collections_multiple_nested_complex_collec AssertSql( """ -SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [t].[Id], [u1].[Nickname], [u1].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Name], [s1].[IsAutomatic], [s1].[Id1], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00], [s2].[Id], [s2].[AmmunitionType], [s2].[IsAutomatic], [s2].[Name], [s2].[OwnerFullName], [s2].[SynergyWithId], [s2].[Nickname], [s2].[SquadId] +SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [t].[Id], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Name], [s1].[IsAutomatic], [s1].[Id0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00], [s2].[Id], [s2].[AmmunitionType], [s2].[IsAutomatic], [s2].[Name], [s2].[OwnerFullName], [s2].[SynergyWithId], [s2].[Nickname], [s2].[SquadId] FROM ( SELECT [o].[Nickname], [o].[SquadId], [o].[FullName], [o].[HasSoulPatch] FROM [Officers] AS [o] @@ -5423,7 +5418,7 @@ UNION ALL FROM [Officers] AS [o1] ) AS [u1] ON [t].[GearNickName] = [u1].[Nickname] AND [t].[GearSquadId] = [u1].[SquadId] LEFT JOIN ( - SELECT [u2].[FullName], [u2].[Nickname], [u2].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Id0], [s0].[Name], [s0].[IsAutomatic], [s0].[Id1], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [u2].[Rank], [s0].[IsAutomatic0], [u2].[LeaderNickname], [u2].[LeaderSquadId] + SELECT [u2].[FullName], [u2].[Nickname], [u2].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Name], [s0].[IsAutomatic], [s0].[Id0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [u2].[Rank], [s0].[IsAutomatic0], [u2].[LeaderNickname], [u2].[LeaderSquadId] FROM ( SELECT [g1].[Nickname], [g1].[SquadId], [g1].[FullName], [g1].[LeaderNickname], [g1].[LeaderSquadId], [g1].[Rank] FROM [Gears] AS [g1] @@ -5432,7 +5427,7 @@ UNION ALL FROM [Officers] AS [o2] ) AS [u2] LEFT JOIN ( - SELECT [w].[Id], [u3].[Nickname], [u3].[SquadId], [s].[Id] AS [Id0], [w0].[Name], [w0].[IsAutomatic], [w0].[Id] AS [Id1], [u4].[Nickname] AS [Nickname0], [u4].[HasSoulPatch], [u4].[SquadId] AS [SquadId0], [w].[IsAutomatic] AS [IsAutomatic0], [w].[OwnerFullName] + SELECT [w].[Id], [u3].[Nickname], [u3].[SquadId], [w0].[Name], [w0].[IsAutomatic], [w0].[Id] AS [Id0], [u4].[Nickname] AS [Nickname0], [u4].[HasSoulPatch], [u4].[SquadId] AS [SquadId0], [w].[IsAutomatic] AS [IsAutomatic0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g2].[Nickname], [g2].[SquadId], [g2].[FullName] @@ -5475,7 +5470,7 @@ UNION ALL FROM [Officers] AS [o0] ) AS [u0] WHERE [u].[Nickname] = [u0].[LeaderNickname] AND [u].[SquadId] = [u0].[LeaderSquadId]) -ORDER BY [u].[HasSoulPatch] DESC, [t].[Note], [u].[Nickname], [u].[SquadId], [t].[Id], [u1].[Nickname], [u1].[SquadId], [s1].[Rank], [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic0], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Id1], [s1].[Nickname00], [s1].[SquadId00], [s2].[IsAutomatic], [s2].[Nickname] DESC, [s2].[Id] +ORDER BY [u].[HasSoulPatch] DESC, [t].[Note], [u].[Nickname], [u].[SquadId], [t].[Id], [s1].[Rank], [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic0], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00], [s1].[SquadId00], [s2].[IsAutomatic], [s2].[Nickname] DESC, [s2].[Id] """); } @@ -5822,7 +5817,7 @@ public override async Task Correlated_collections_deeply_nested_left_join(bool a AssertSql( """ -SELECT [t].[Id], [u].[Nickname], [u].[SquadId], [s].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[SynergyWithId] +SELECT [t].[Id], [u].[Nickname], [u].[SquadId], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[SynergyWithId] FROM [Tags] AS [t] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId] @@ -5848,7 +5843,7 @@ FROM [Weapons] AS [w] ) AS [w0] ON [u0].[FullName] = [w0].[OwnerFullName] WHERE [u0].[HasSoulPatch] = CAST(1 AS bit) ) AS [s0] ON [s].[Id] = [s0].[SquadId] -ORDER BY [t].[Note], [u].[Nickname] DESC, [t].[Id], [u].[SquadId], [s].[Id], [s0].[Nickname], [s0].[SquadId] +ORDER BY [t].[Note], [u].[Nickname] DESC, [t].[Id], [u].[SquadId], [s0].[Nickname], [s0].[SquadId] """); } @@ -5858,7 +5853,7 @@ public override async Task Correlated_collections_from_left_join_with_additional AssertSql( """ -SELECT [w].[Id], [u].[Nickname], [u].[SquadId], [s].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[SynergyWithId], [s0].[Rank] +SELECT [w].[Id], [u].[Nickname], [u].[SquadId], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[SynergyWithId], [s0].[Rank] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName] @@ -5883,7 +5878,7 @@ FROM [Weapons] AS [w0] WHERE [w0].[IsAutomatic] = CAST(0 AS bit) ) AS [w1] ON [u0].[FullName] = [w1].[OwnerFullName] ) AS [s0] ON [s].[Id] = [s0].[SquadId] -ORDER BY [w].[Name], [w].[Id], [u].[Nickname], [u].[SquadId], [s].[Id], [s0].[FullName] DESC, [s0].[Nickname], [s0].[SquadId], [s0].[Id] +ORDER BY [w].[Name], [w].[Id], [u].[Nickname], [u].[SquadId], [s0].[FullName] DESC, [s0].[Nickname], [s0].[SquadId], [s0].[Id] """); } @@ -5893,7 +5888,7 @@ public override async Task Correlated_collections_complex_scenario1(bool async) AssertSql( """ -SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] +SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName] FROM [Gears] AS [g] @@ -5902,7 +5897,7 @@ UNION ALL FROM [Officers] AS [o] ) AS [u] LEFT JOIN ( - SELECT [w].[Id], [u0].[Nickname], [u0].[SquadId], [s].[Id] AS [Id0], [u1].[Nickname] AS [Nickname0], [u1].[HasSoulPatch], [u1].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [u0].[Nickname], [u0].[SquadId], [u1].[Nickname] AS [Nickname0], [u1].[HasSoulPatch], [u1].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g0].[Nickname], [g0].[SquadId], [g0].[FullName] @@ -5920,7 +5915,7 @@ UNION ALL FROM [Officers] AS [o1] ) AS [u1] ON [s].[Id] = [u1].[SquadId] ) AS [s0] ON [u].[FullName] = [s0].[OwnerFullName] -ORDER BY [u].[Nickname], [u].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0] +ORDER BY [u].[Nickname], [u].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0] """); } @@ -5930,13 +5925,13 @@ public override async Task Correlated_collections_complex_scenario2(bool async) AssertSql( """ -SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] +SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] FROM ( SELECT [o].[Nickname], [o].[SquadId], [o].[FullName] FROM [Officers] AS [o] ) AS [u] LEFT JOIN ( - SELECT [u0].[FullName], [u0].[Nickname], [u0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Id0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [u0].[LeaderNickname], [u0].[LeaderSquadId] + SELECT [u0].[FullName], [u0].[Nickname], [u0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [u0].[LeaderNickname], [u0].[LeaderSquadId] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName], [g].[LeaderNickname], [g].[LeaderSquadId] FROM [Gears] AS [g] @@ -5945,7 +5940,7 @@ UNION ALL FROM [Officers] AS [o0] ) AS [u0] LEFT JOIN ( - SELECT [w].[Id], [u1].[Nickname], [u1].[SquadId], [s].[Id] AS [Id0], [u2].[Nickname] AS [Nickname0], [u2].[HasSoulPatch], [u2].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [u1].[Nickname], [u1].[SquadId], [u2].[Nickname] AS [Nickname0], [u2].[HasSoulPatch], [u2].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g0].[Nickname], [g0].[SquadId], [g0].[FullName] @@ -5964,7 +5959,7 @@ FROM [Officers] AS [o2] ) AS [u2] ON [s].[Id] = [u2].[SquadId] ) AS [s0] ON [u0].[FullName] = [s0].[OwnerFullName] ) AS [s1] ON [u].[Nickname] = [s1].[LeaderNickname] AND [u].[SquadId] = [s1].[LeaderSquadId] -ORDER BY [u].[Nickname], [u].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00] +ORDER BY [u].[Nickname], [u].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00] """); } @@ -5974,7 +5969,7 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] +SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName] FROM [Gears] AS [g] @@ -5983,7 +5978,7 @@ UNION ALL FROM [Officers] AS [o] ) AS [u] LEFT JOIN ( - SELECT [w].[Id], [u0].[Nickname], [u0].[SquadId], [s].[Id] AS [Id0], [u1].[Nickname] AS [Nickname0], [u1].[HasSoulPatch], [u1].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [u0].[Nickname], [u0].[SquadId], [u1].[Nickname] AS [Nickname0], [u1].[HasSoulPatch], [u1].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g0].[Nickname], [g0].[SquadId], [g0].[FullName] @@ -6001,7 +5996,7 @@ UNION ALL FROM [Officers] AS [o1] ) AS [u1] ON [s].[Id] = [u1].[SquadId] ) AS [s0] ON [u].[FullName] = [s0].[OwnerFullName] -ORDER BY [u].[FullName], [u].[Nickname] DESC, [u].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0] +ORDER BY [u].[FullName], [u].[Nickname] DESC, [u].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0] """); } @@ -6011,13 +6006,13 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] +SELECT [u].[FullName], [u].[Nickname], [u].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] FROM ( SELECT [o].[Nickname], [o].[SquadId], [o].[FullName], [o].[HasSoulPatch], [o].[LeaderNickname] FROM [Officers] AS [o] ) AS [u] LEFT JOIN ( - SELECT [u0].[FullName], [u0].[Nickname], [u0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Id0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [u0].[HasSoulPatch] AS [HasSoulPatch0], [s0].[IsAutomatic], [s0].[Name], [u0].[LeaderNickname], [u0].[LeaderSquadId] + SELECT [u0].[FullName], [u0].[Nickname], [u0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [u0].[HasSoulPatch] AS [HasSoulPatch0], [s0].[IsAutomatic], [s0].[Name], [u0].[LeaderNickname], [u0].[LeaderSquadId] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId] FROM [Gears] AS [g] @@ -6026,7 +6021,7 @@ UNION ALL FROM [Officers] AS [o0] ) AS [u0] LEFT JOIN ( - SELECT [w].[Id], [u1].[Nickname], [u1].[SquadId], [s].[Id] AS [Id0], [u2].[Nickname] AS [Nickname0], [u2].[HasSoulPatch], [u2].[SquadId] AS [SquadId0], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName] + SELECT [w].[Id], [u1].[Nickname], [u1].[SquadId], [u2].[Nickname] AS [Nickname0], [u2].[HasSoulPatch], [u2].[SquadId] AS [SquadId0], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g0].[Nickname], [g0].[SquadId], [g0].[FullName] @@ -6045,7 +6040,7 @@ FROM [Officers] AS [o2] ) AS [u2] ON [s].[Id] = [u2].[SquadId] ) AS [s0] ON [u0].[FullName] = [s0].[OwnerFullName] ) AS [s1] ON [u].[Nickname] = [s1].[LeaderNickname] AND [u].[SquadId] = [s1].[LeaderSquadId] -ORDER BY [u].[HasSoulPatch], [u].[LeaderNickname], [u].[FullName], [u].[Nickname], [u].[SquadId], [s1].[FullName], [s1].[HasSoulPatch0] DESC, [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic], [s1].[Name] DESC, [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00] +ORDER BY [u].[HasSoulPatch], [u].[LeaderNickname], [u].[FullName], [u].[Nickname], [u].[SquadId], [s1].[FullName], [s1].[HasSoulPatch0] DESC, [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic], [s1].[Name] DESC, [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00] """); } @@ -6210,7 +6205,7 @@ LEFT JOIN [Tags] AS [t] ON ([u0].[Nickname] = [t].[GearNickName] OR ([u0].[Nickn ORDER BY [t].[Note] ) AS [s] LEFT JOIN [Weapons] AS [w] ON [s].[FullName] = [w].[OwnerFullName] -ORDER BY [s].[Note], [s].[Name], [s].[Nickname], [s].[SquadId], [s].[Id] +ORDER BY [s].[Note], [s].[Name], [s].[Id] """); } @@ -7787,7 +7782,7 @@ GROUP BY [u].[Rank] LEFT JOIN ( SELECT [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[Rank], [s].[Discriminator], [s].[Name], [s].[Location], [s].[Nation] FROM ( - SELECT [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator], [c].[Name], [c].[Location], [c].[Nation], ROW_NUMBER() OVER(PARTITION BY [u0].[Rank] ORDER BY [u0].[Nickname], [u0].[SquadId], [c].[Name]) AS [row] + SELECT [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator], [c].[Name], [c].[Location], [c].[Nation], ROW_NUMBER() OVER(PARTITION BY [u0].[Rank] ORDER BY [u0].[Nickname], [u0].[SquadId]) AS [row] FROM ( SELECT [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank], N'Gear' AS [Discriminator] FROM [Gears] AS [g0] @@ -8362,7 +8357,7 @@ public override async Task Project_collection_navigation_nested_with_take_compos AssertSql( """ -SELECT [t].[Id], [u].[Nickname], [u].[SquadId], [u2].[Nickname], [u2].[SquadId], [u2].[AssignedCityName], [u2].[CityOfBirthName], [u2].[FullName], [u2].[HasSoulPatch], [u2].[LeaderNickname], [u2].[LeaderSquadId], [u2].[Rank], [u2].[Discriminator] +SELECT [t].[Id], [u2].[Nickname], [u2].[SquadId], [u2].[AssignedCityName], [u2].[CityOfBirthName], [u2].[FullName], [u2].[HasSoulPatch], [u2].[LeaderNickname], [u2].[LeaderSquadId], [u2].[Rank], [u2].[Discriminator] FROM [Tags] AS [t] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId], N'Gear' AS [Discriminator] @@ -8386,7 +8381,7 @@ FROM [Officers] AS [o0] WHERE [u1].[row] <= 50 ) AS [u2] ON ([u].[Nickname] = [u2].[LeaderNickname] OR ([u].[Nickname] IS NULL AND [u2].[LeaderNickname] IS NULL)) AND [u].[SquadId] = [u2].[LeaderSquadId] WHERE [u].[Discriminator] = N'Officer' -ORDER BY [t].[Id], [u].[Nickname], [u].[SquadId], [u2].[Nickname] +ORDER BY [t].[Id], [u2].[Nickname] """); } @@ -8396,7 +8391,7 @@ public override async Task Project_collection_navigation_nested_composite_key(bo AssertSql( """ -SELECT [t].[Id], [u].[Nickname], [u].[SquadId], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] +SELECT [t].[Id], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] FROM [Tags] AS [t] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId], N'Gear' AS [Discriminator] @@ -8413,7 +8408,7 @@ UNION ALL FROM [Officers] AS [o0] ) AS [u0] ON ([u].[Nickname] = [u0].[LeaderNickname] OR ([u].[Nickname] IS NULL AND [u0].[LeaderNickname] IS NULL)) AND [u].[SquadId] = [u0].[LeaderSquadId] WHERE [u].[Discriminator] = N'Officer' -ORDER BY [t].[Id], [u].[Nickname], [u].[SquadId], [u0].[Nickname] +ORDER BY [t].[Id], [u0].[Nickname] """); } @@ -8667,7 +8662,7 @@ public override async Task Accessing_reference_navigation_collection_composition AssertSql( """ -SELECT [u].[Nickname], [u].[SquadId], [s].[Id], [s].[IsAutomatic], [s].[Name], [s].[Id0] +SELECT [u].[Nickname], [u].[SquadId], [s].[Id], [s].[IsAutomatic], [s].[Name] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName] FROM [Gears] AS [g] @@ -8676,11 +8671,11 @@ UNION ALL FROM [Officers] AS [o] ) AS [u] LEFT JOIN ( - SELECT [w].[Id], [w].[IsAutomatic], [w0].[Name], [w0].[Id] AS [Id0], [w].[OwnerFullName] + SELECT [w].[Id], [w].[IsAutomatic], [w0].[Name], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN [Weapons] AS [w0] ON [w].[SynergyWithId] = [w0].[Id] ) AS [s] ON [u].[FullName] = [s].[OwnerFullName] -ORDER BY [u].[Nickname], [u].[SquadId], [s].[Id] +ORDER BY [u].[Nickname], [u].[SquadId] """); } @@ -8713,7 +8708,7 @@ public override async Task Accessing_property_of_optional_navigation_in_child_pr SELECT CASE WHEN [u].[Nickname] IS NOT NULL AND [u].[SquadId] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) -END, [t].[Id], [u].[Nickname], [u].[SquadId], [s].[Nickname], [s].[Id], [s].[SquadId] +END, [t].[Id], [s].[Nickname], [s].[Id], [s].[SquadId] FROM [Tags] AS [t] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName] @@ -8733,7 +8728,7 @@ UNION ALL FROM [Officers] AS [o0] ) AS [u0] ON [w].[OwnerFullName] = [u0].[FullName] ) AS [s] ON [u].[FullName] = [s].[OwnerFullName] -ORDER BY [t].[Note], [t].[Id], [u].[Nickname], [u].[SquadId], [s].[Id], [s].[Nickname] +ORDER BY [t].[Note], [t].[Id], [s].[Id], [s].[Nickname] """); } @@ -10316,7 +10311,7 @@ public override async Task Correlated_collection_take(bool async) AssertSql( """ -SELECT [u].[Nickname], [u].[SquadId], [c].[Name], [w1].[Id], [w1].[AmmunitionType], [w1].[IsAutomatic], [w1].[Name], [w1].[OwnerFullName], [w1].[SynergyWithId], [c].[Location], [c].[Nation] +SELECT [u].[Nickname], [u].[SquadId], [w1].[Id], [w1].[AmmunitionType], [w1].[IsAutomatic], [w1].[Name], [w1].[OwnerFullName], [w1].[SynergyWithId], [c].[Name], [c].[Location], [c].[Nation] FROM ( SELECT [g].[Nickname], [g].[SquadId], [g].[CityOfBirthName], [g].[FullName] FROM [Gears] AS [g] @@ -10333,7 +10328,7 @@ FROM [Weapons] AS [w] ) AS [w0] WHERE [w0].[row] <= 10 ) AS [w1] ON [u].[FullName] = [w1].[OwnerFullName] -ORDER BY [u].[Nickname], [u].[SquadId], [c].[Name] +ORDER BY [u].[Nickname], [u].[SquadId] """); } @@ -11019,7 +11014,7 @@ FROM [Weapons] AS [w0] ) AS [w1] WHERE [w1].[row] <= 1 ) AS [w2] ON [u].[FullName] = [w2].[OwnerFullName] -ORDER BY [u].[Nickname], [u].[SquadId], [s].[Id] +ORDER BY [u].[Nickname], [u].[SquadId] """); } @@ -11293,7 +11288,7 @@ FROM [Officers] AS [o] ) AS [u0] ON [u].[DefeatedByNickname] = [u0].[Nickname] AND [u].[DefeatedBySquadId] = [u0].[SquadId] LEFT JOIN [Weapons] AS [w] ON [u0].[FullName] = [w].[OwnerFullName] WHERE [u].[Name] LIKE N'%Queen%' -ORDER BY [u].[Name], [u0].[Nickname], [u0].[SquadId] +ORDER BY [u].[Name] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCManyToManyNoTrackingQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCManyToManyNoTrackingQuerySqlServerTest.cs index 4666c6bd00d..6b981fe5829 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCManyToManyNoTrackingQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCManyToManyNoTrackingQuerySqlServerTest.cs @@ -399,7 +399,7 @@ LEFT JOIN ( FROM [JoinCompositeKeyToLeaf] AS [j] INNER JOIN [Leaves] AS [l] ON [j].[LeafId] = [l].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeId1] AND [e].[Key2] = [s].[CompositeId2] AND [e].[Key3] = [s].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2] """); } @@ -429,7 +429,7 @@ FROM [Leaf2s] AS [l0] ) AS [u] ON [e0].[RootSkipSharedId] = [u].[Id] WHERE [u].[Discriminator] = N'EntityLeaf' ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -641,7 +641,7 @@ LEFT JOIN ( FROM [JoinOneSelfPayload] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[LeftId] = [e0].[Id] ) AS [s] ON [e].[Id] = [s].[RightId] -ORDER BY [e].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [e].[Id], [s].[LeftId] """); } @@ -668,7 +668,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e3] INNER JOIN [EntityCompositeKeys] AS [e4] ON [e3].[CompositeKeySkipSharedKey1] = [e4].[Key1] AND [e3].[CompositeKeySkipSharedKey2] = [e4].[Key2] AND [e3].[CompositeKeySkipSharedKey3] = [e4].[Key3] ) AS [s1] ON [e].[Id] = [s1].[TwoSkipSharedId] -ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s].[Id], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s0].[Id], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2] +ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2] """); } @@ -718,7 +718,7 @@ UNION ALL FROM [Leaf2s] AS [l0] ) AS [u] ON [e0].[RootSkipSharedId] = [u].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -736,7 +736,7 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """); } @@ -758,7 +758,7 @@ FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e0] ON [j0].[EntityOneId] = [e0].[Id] ) AS [s] ON [l].[Id] = [s].[EntityBranchId] ) AS [s0] ON [e].[Key1] = [s0].[CompositeId1] AND [e].[Key2] = [s0].[CompositeId2] AND [e].[Key3] = [s0].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id], [s0].[EntityBranchId], [s0].[EntityOneId] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[EntityBranchId] """); } @@ -781,7 +781,7 @@ FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s] ON [e0].[Id] = [s].[LeftId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -799,7 +799,7 @@ LEFT JOIN ( FROM [EntityOneEntityTwo] AS [e1] INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] ) AS [s] ON [e].[Id] = [s].[TwoSkipSharedId] -ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId] """); } @@ -817,7 +817,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -932,7 +932,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] WHERE [e1].[Id] < 10 ) AS [s] ON [e0].[Id] = [s].[ThreeId] ) AS [s0] ON [u].[Id] = [s0].[RootSkipSharedId] -ORDER BY [u].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[Id], [s0].[OneId], [s0].[ThreeId] +ORDER BY [u].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[OneId] """); } @@ -970,7 +970,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] WHERE 1 < [s].[row] AND [s].[row] <= 3 ) AS [s0] ON [e0].[Key1] = [s0].[CompositeId1] AND [e0].[Key2] = [s0].[CompositeId2] AND [e0].[Key3] = [s0].[CompositeId3] ) AS [s1] ON [u].[Id] = [s1].[RootSkipSharedId] -ORDER BY [u].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2], [s1].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] +ORDER BY [u].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] """); } @@ -993,7 +993,7 @@ FROM [EntityCompositeKeyEntityTwo] AS [e0] ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] WHERE [e].[Key1] < 5 ) AS [s0] ON [l].[Id] = [s0].[LeafId] -ORDER BY [l].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [l].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -1022,7 +1022,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -1049,7 +1049,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] ON [e0].[Id] = [s0].[TwoId] WHERE [e0].[Id] < 10 ) AS [s1] ON [e].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[Id], [s1].[TwoId0], [s1].[Id0] +ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[TwoId0], [s1].[Id0] """); } @@ -1069,7 +1069,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1108,7 +1108,7 @@ WHERE [u].[Id] < 20 ) AS [s1] ON [e0].[Id] = [s1].[EntityOneId] WHERE [e0].[Id] < 10 ) AS [s2] ON [e].[Id] = [s2].[ThreeId] -ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[Id], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId], [s2].[EntityOneId] +ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId] """); } @@ -1131,7 +1131,7 @@ WHERE [e1].[Id] < 5 ) AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1154,7 +1154,7 @@ WHERE [e1].[Id] < 5 ) AS [s] ON [e0].[Id] = [s].[TwoId] WHERE [e0].[Id] > 15 ) AS [s0] ON [e].[Id] = [s0].[CollectionInverseId] -ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId], [s0].[TwoId] +ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId] """); } @@ -1250,11 +1250,11 @@ INNER JOIN ( FROM [JoinCompositeKeyToLeaf] AS [j] INNER JOIN [Leaves] AS [l] ON [j].[LeafId] = [l].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeId1] AND [e].[Key2] = [s].[CompositeId2] AND [e].[Key3] = [s].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[Id], [s0].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +SELECT [s0].[Id], [s0].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [EntityCompositeKeys] AS [e] INNER JOIN ( SELECT [l].[Id], [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3] @@ -1266,7 +1266,7 @@ INNER JOIN ( FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e0] ON [j0].[EntityOneId] = [e0].[Id] ) AS [s0] ON [s].[Id] = [s0].[EntityBranchId] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1290,11 +1290,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """, // """ -SELECT [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +SELECT [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [e1].[Id] AS [Id0], [j].[OneId], [j].[ThreeId] @@ -1307,7 +1307,7 @@ INNER JOIN ( FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s0] ON [s].[Id] = [s0].[LeftId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """); } @@ -1507,11 +1507,11 @@ INNER JOIN ( FROM [EntityRootEntityThree] AS [e] INNER JOIN [EntityThrees] AS [e0] ON [e].[ThreeSkipSharedId] = [e0].[Id] ) AS [s] ON [u].[Id] = [s].[RootSkipSharedId] -ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """, // """ -SELECT [s0].[Id], [s0].[Name], [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +SELECT [s0].[Id], [s0].[Name], [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] FROM ( SELECT [r].[Id] FROM [Roots] AS [r] @@ -1536,7 +1536,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e1] ON [j].[OneId] = [e1].[Id] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[ThreeId] -ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """); } @@ -1583,11 +1583,11 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityRoot] AS [e] INNER JOIN [EntityCompositeKeys] AS [e0] ON [e].[CompositeKeySkipSharedKey1] = [e0].[Key1] AND [e].[CompositeKeySkipSharedKey2] = [e0].[Key2] AND [e].[CompositeKeySkipSharedKey3] = [e0].[Key3] ) AS [s] ON [u].[Id] = [s].[RootSkipSharedId] -ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] FROM ( SELECT [r].[Id] FROM [Roots] AS [r] @@ -1615,7 +1615,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Key1] = [s1].[CompositeId1] AND [s].[Key2] = [s1].[CompositeId2] AND [s].[Key3] = [s1].[CompositeId3] -ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] +ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] """); } @@ -1639,11 +1639,11 @@ FROM [JoinCompositeKeyToLeaf] AS [j] INNER JOIN [EntityCompositeKeys] AS [e] ON [j].[CompositeId1] = [e].[Key1] AND [j].[CompositeId2] = [e].[Key2] AND [j].[CompositeId3] = [e].[Key3] WHERE [e].[Key1] < 5 ) AS [s] ON [l].[Id] = [s].[LeafId] -ORDER BY [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [Leaves] AS [l] INNER JOIN ( SELECT [e].[Key1], [e].[Key2], [e].[Key3], [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3] @@ -1656,7 +1656,7 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e0] INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] ) AS [s0] ON [s].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [s].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [s].[Key3] = [s0].[CompositeKeySkipSharedKey3] -ORDER BY [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1687,7 +1687,7 @@ FROM [JoinOneToTwo] AS [j] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId], [s0].[Id] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [s].[Id], [s].[OneId], [s].[TwoId] @@ -1728,11 +1728,11 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityTwos] AS [e0] ON [j].[TwoId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[TwoId] @@ -1749,7 +1749,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s1].[TwoId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s1].[TwoId], [s1].[Id] """); } @@ -1774,11 +1774,11 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] FROM [EntityTwos] AS [e] INNER JOIN ( SELECT [e0].[Id], [e1].[Id] AS [Id0], [j].[OneId], [j].[TwoId] @@ -1788,7 +1788,7 @@ FROM [JoinOneToTwo] AS [j] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] INNER JOIN [EntityTwos] AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1812,11 +1812,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[ThreeId] @@ -1833,11 +1833,11 @@ FROM [JoinOneToTwo] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s1].[OneId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s1].[OneId], [s1].[Id] """, // """ -SELECT [s2].[Id], [s2].[Name], [s2].[Number], [s2].[IsGreen], [s2].[Discriminator], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [s2].[Id], [s2].[Name], [s2].[Number], [s2].[IsGreen], [s2].[Discriminator], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[ThreeId] @@ -1857,7 +1857,7 @@ FROM [Leaves] AS [l] ) AS [u] ON [j1].[EntityBranchId] = [u].[Id] WHERE [u].[Id] < 20 ) AS [s2] ON [s].[Id] = [s2].[EntityOneId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1881,11 +1881,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[ThreeId] @@ -1898,7 +1898,7 @@ INNER JOIN ( FROM [EntityTwos] AS [e1] WHERE [e1].[Id] < 5 ) AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -2109,7 +2109,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -2264,7 +2264,7 @@ FROM [UnidirectionalLeaves] AS [u4] ) AS [u1] ON [u0].[RootSkipSharedId] = [u1].[Id] WHERE [u1].[Discriminator] = N'UnidirectionalEntityLeaf' ) AS [s] ON [u].[Key1] = [s].[UnidirectionalEntityCompositeKeyKey1] AND [u].[Key2] = [s].[UnidirectionalEntityCompositeKeyKey2] AND [u].[Key3] = [s].[UnidirectionalEntityCompositeKeyKey3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s].[RootSkipSharedId], [s].[UnidirectionalEntityCompositeKeyKey1], [s].[UnidirectionalEntityCompositeKeyKey2], [s].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s].[RootSkipSharedId], [s].[UnidirectionalEntityCompositeKeyKey1], [s].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2424,7 +2424,7 @@ LEFT JOIN ( FROM [UnidirectionalJoinOneSelfPayload] AS [u0] INNER JOIN [UnidirectionalEntityOnes] AS [u1] ON [u0].[LeftId] = [u1].[Id] ) AS [s] ON [u].[Id] = [s].[RightId] -ORDER BY [u].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [u].[Id], [s].[LeftId] """); } @@ -2450,7 +2450,7 @@ UNION ALL FROM [UnidirectionalLeaves] AS [u4] ) AS [u1] ON [u0].[RootSkipSharedId] = [u1].[Id] ) AS [s] ON [u].[Key1] = [s].[UnidirectionalEntityCompositeKeyKey1] AND [u].[Key2] = [s].[UnidirectionalEntityCompositeKeyKey2] AND [u].[Key3] = [s].[UnidirectionalEntityCompositeKeyKey3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s].[RootSkipSharedId], [s].[UnidirectionalEntityCompositeKeyKey1], [s].[UnidirectionalEntityCompositeKeyKey2], [s].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s].[RootSkipSharedId], [s].[UnidirectionalEntityCompositeKeyKey1], [s].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2468,7 +2468,7 @@ FROM [UnidirectionalJoinOneToTwo] AS [u0] INNER JOIN [UnidirectionalEntityOnes] AS [u1] ON [u0].[OneId] = [u1].[Id] LEFT JOIN [UnidirectionalEntityTwos] AS [u2] ON [u1].[Id] = [u2].[ReferenceInverseId] ) AS [s] ON [u].[Id] = [s].[TwoId] -ORDER BY [u].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [u].[Id], [s].[OneId], [s].[TwoId] """); } @@ -2490,7 +2490,7 @@ FROM [UnidirectionalJoinOneToBranch] AS [u2] INNER JOIN [UnidirectionalEntityOnes] AS [u3] ON [u2].[UnidirectionalEntityOneId] = [u3].[Id] ) AS [s] ON [u1].[Id] = [s].[UnidirectionalEntityBranchId] ) AS [s0] ON [u].[Key1] = [s0].[CompositeId1] AND [u].[Key2] = [s0].[CompositeId2] AND [u].[Key3] = [s0].[CompositeId3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id], [s0].[UnidirectionalEntityBranchId], [s0].[UnidirectionalEntityOneId] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[UnidirectionalEntityBranchId] """); } @@ -2513,7 +2513,7 @@ FROM [UnidirectionalJoinOneSelfPayload] AS [u3] INNER JOIN [UnidirectionalEntityOnes] AS [u4] ON [u3].[RightId] = [u4].[Id] ) AS [s] ON [u1].[Id] = [s].[LeftId] ) AS [s0] ON [u].[Id] = [s0].[ThreeId] -ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -2531,7 +2531,7 @@ LEFT JOIN ( FROM [UnidirectionalEntityOneUnidirectionalEntityTwo] AS [u1] INNER JOIN [UnidirectionalEntityOnes] AS [u2] ON [u1].[UnidirectionalEntityOneId] = [u2].[Id] ) AS [s] ON [u].[Id] = [s].[TwoSkipSharedId] -ORDER BY [u].[Id], [u0].[Id], [s].[TwoSkipSharedId], [s].[UnidirectionalEntityOneId] +ORDER BY [u].[Id], [u0].[Id], [s].[TwoSkipSharedId] """); } @@ -2549,7 +2549,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -2651,7 +2651,7 @@ FROM [UnidirectionalEntityCompositeKeyUnidirectionalEntityTwo] AS [u2] ) AS [s] ON [u1].[Key1] = [s].[UnidirectionalEntityCompositeKeyKey1] AND [u1].[Key2] = [s].[UnidirectionalEntityCompositeKeyKey2] AND [u1].[Key3] = [s].[UnidirectionalEntityCompositeKeyKey3] WHERE [u1].[Key1] < 5 ) AS [s0] ON [u].[Id] = [s0].[LeafId] -ORDER BY [u].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2], [s0].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2671,7 +2671,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCManyToManyQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCManyToManyQuerySqlServerTest.cs index 338965af09a..c2f7b4dc39c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCManyToManyQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCManyToManyQuerySqlServerTest.cs @@ -399,7 +399,7 @@ LEFT JOIN ( FROM [JoinCompositeKeyToLeaf] AS [j] INNER JOIN [Leaves] AS [l] ON [j].[LeafId] = [l].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeId1] AND [e].[Key2] = [s].[CompositeId2] AND [e].[Key3] = [s].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2] """); } @@ -429,7 +429,7 @@ FROM [Leaf2s] AS [l0] ) AS [u] ON [e0].[RootSkipSharedId] = [u].[Id] WHERE [u].[Discriminator] = N'EntityLeaf' ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -641,7 +641,7 @@ LEFT JOIN ( FROM [JoinOneSelfPayload] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[LeftId] = [e0].[Id] ) AS [s] ON [e].[Id] = [s].[RightId] -ORDER BY [e].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [e].[Id], [s].[LeftId] """); } @@ -668,7 +668,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e3] INNER JOIN [EntityCompositeKeys] AS [e4] ON [e3].[CompositeKeySkipSharedKey1] = [e4].[Key1] AND [e3].[CompositeKeySkipSharedKey2] = [e4].[Key2] AND [e3].[CompositeKeySkipSharedKey3] = [e4].[Key3] ) AS [s1] ON [e].[Id] = [s1].[TwoSkipSharedId] -ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s].[Id], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s0].[Id], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2] +ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2] """); } @@ -718,7 +718,7 @@ UNION ALL FROM [Leaf2s] AS [l0] ) AS [u] ON [e0].[RootSkipSharedId] = [u].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -736,7 +736,7 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """); } @@ -758,7 +758,7 @@ FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e0] ON [j0].[EntityOneId] = [e0].[Id] ) AS [s] ON [l].[Id] = [s].[EntityBranchId] ) AS [s0] ON [e].[Key1] = [s0].[CompositeId1] AND [e].[Key2] = [s0].[CompositeId2] AND [e].[Key3] = [s0].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id], [s0].[EntityBranchId], [s0].[EntityOneId] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[EntityBranchId] """); } @@ -781,7 +781,7 @@ FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s] ON [e0].[Id] = [s].[LeftId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -799,7 +799,7 @@ LEFT JOIN ( FROM [EntityOneEntityTwo] AS [e1] INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] ) AS [s] ON [e].[Id] = [s].[TwoSkipSharedId] -ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId] """); } @@ -817,7 +817,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -932,7 +932,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] WHERE [e1].[Id] < 10 ) AS [s] ON [e0].[Id] = [s].[ThreeId] ) AS [s0] ON [u].[Id] = [s0].[RootSkipSharedId] -ORDER BY [u].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[Id], [s0].[OneId], [s0].[ThreeId] +ORDER BY [u].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[OneId] """); } @@ -970,7 +970,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] WHERE 1 < [s].[row] AND [s].[row] <= 3 ) AS [s0] ON [e0].[Key1] = [s0].[CompositeId1] AND [e0].[Key2] = [s0].[CompositeId2] AND [e0].[Key3] = [s0].[CompositeId3] ) AS [s1] ON [u].[Id] = [s1].[RootSkipSharedId] -ORDER BY [u].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2], [s1].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] +ORDER BY [u].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] """); } @@ -993,7 +993,7 @@ FROM [EntityCompositeKeyEntityTwo] AS [e0] ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] WHERE [e].[Key1] < 5 ) AS [s0] ON [l].[Id] = [s0].[LeafId] -ORDER BY [l].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [l].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -1022,7 +1022,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -1049,7 +1049,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] ON [e0].[Id] = [s0].[TwoId] WHERE [e0].[Id] < 10 ) AS [s1] ON [e].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[Id], [s1].[TwoId0], [s1].[Id0] +ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[TwoId0], [s1].[Id0] """); } @@ -1069,7 +1069,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1108,7 +1108,7 @@ WHERE [u].[Id] < 20 ) AS [s1] ON [e0].[Id] = [s1].[EntityOneId] WHERE [e0].[Id] < 10 ) AS [s2] ON [e].[Id] = [s2].[ThreeId] -ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[Id], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId], [s2].[EntityOneId] +ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId] """); } @@ -1131,7 +1131,7 @@ WHERE [e1].[Id] < 5 ) AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1154,7 +1154,7 @@ WHERE [e1].[Id] < 5 ) AS [s] ON [e0].[Id] = [s].[TwoId] WHERE [e0].[Id] > 15 ) AS [s0] ON [e].[Id] = [s0].[CollectionInverseId] -ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId], [s0].[TwoId] +ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId] """); } @@ -1250,11 +1250,11 @@ INNER JOIN ( FROM [JoinCompositeKeyToLeaf] AS [j] INNER JOIN [Leaves] AS [l] ON [j].[LeafId] = [l].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeId1] AND [e].[Key2] = [s].[CompositeId2] AND [e].[Key3] = [s].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[EntityBranchId], [s0].[EntityOneId], [s0].[Id], [s0].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +SELECT [s0].[EntityBranchId], [s0].[EntityOneId], [s0].[Id], [s0].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [EntityCompositeKeys] AS [e] INNER JOIN ( SELECT [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [l].[Id] @@ -1266,7 +1266,7 @@ INNER JOIN ( FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e0] ON [j0].[EntityOneId] = [e0].[Id] ) AS [s0] ON [s].[Id] = [s0].[EntityBranchId] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1290,11 +1290,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """, // """ -SELECT [s0].[LeftId], [s0].[RightId], [s0].[Payload], [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +SELECT [s0].[LeftId], [s0].[RightId], [s0].[Payload], [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id], [e1].[Id] AS [Id0] @@ -1307,7 +1307,7 @@ INNER JOIN ( FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s0] ON [s].[Id] = [s0].[LeftId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """); } @@ -1507,11 +1507,11 @@ INNER JOIN ( FROM [EntityRootEntityThree] AS [e] INNER JOIN [EntityThrees] AS [e0] ON [e].[ThreeSkipSharedId] = [e0].[Id] ) AS [s] ON [u].[Id] = [s].[RootSkipSharedId] -ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """, // """ -SELECT [s0].[OneId], [s0].[ThreeId], [s0].[Payload], [s0].[Id], [s0].[Name], [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +SELECT [s0].[OneId], [s0].[ThreeId], [s0].[Payload], [s0].[Id], [s0].[Name], [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] FROM ( SELECT [r].[Id] FROM [Roots] AS [r] @@ -1536,7 +1536,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e1] ON [j].[OneId] = [e1].[Id] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[ThreeId] -ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """); } @@ -1583,11 +1583,11 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityRoot] AS [e] INNER JOIN [EntityCompositeKeys] AS [e0] ON [e].[CompositeKeySkipSharedKey1] = [e0].[Key1] AND [e].[CompositeKeySkipSharedKey2] = [e0].[Key2] AND [e].[CompositeKeySkipSharedKey3] = [e0].[Key3] ) AS [s] ON [u].[Id] = [s].[RootSkipSharedId] -ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] """, // """ -SELECT [s1].[Id], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[ThreeId], [s1].[Id0], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s1].[Id], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[ThreeId], [s1].[Id0], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] FROM ( SELECT [r].[Id] FROM [Roots] AS [r] @@ -1615,7 +1615,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Key1] = [s1].[CompositeId1] AND [s].[Key2] = [s1].[CompositeId2] AND [s].[Key3] = [s1].[CompositeId3] -ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] +ORDER BY [u].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] """); } @@ -1639,11 +1639,11 @@ FROM [JoinCompositeKeyToLeaf] AS [j] INNER JOIN [EntityCompositeKeys] AS [e] ON [j].[CompositeId1] = [e].[Key1] AND [j].[CompositeId2] = [e].[Key2] AND [j].[CompositeId3] = [e].[Key3] WHERE [e].[Key1] < 5 ) AS [s] ON [l].[Id] = [s].[LeafId] -ORDER BY [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3], [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3], [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [Leaves] AS [l] INNER JOIN ( SELECT [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [e].[Key1], [e].[Key2], [e].[Key3] @@ -1656,7 +1656,7 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e0] INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] ) AS [s0] ON [s].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [s].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [s].[Key3] = [s0].[CompositeKeySkipSharedKey3] -ORDER BY [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [l].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1687,7 +1687,7 @@ FROM [JoinOneToTwo] AS [j] """, // """ -SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId], [s0].[Id] +SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [s].[OneId], [s].[TwoId], [s].[Id] @@ -1728,11 +1728,11 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityTwos] AS [e0] ON [j].[TwoId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """, // """ -SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[TwoId], [e0].[Id] @@ -1749,7 +1749,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s1].[TwoId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s1].[TwoId], [s1].[Id] """); } @@ -1774,11 +1774,11 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] FROM [EntityTwos] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[TwoId], [e0].[Id], [e1].[Id] AS [Id0] @@ -1788,7 +1788,7 @@ FROM [JoinOneToTwo] AS [j] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] INNER JOIN [EntityTwos] AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1812,11 +1812,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [s1].[OneId], [s1].[TwoId], [s1].[JoinOneToTwoExtraId], [s1].[Id], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [s1].[OneId], [s1].[TwoId], [s1].[JoinOneToTwoExtraId], [s1].[Id], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id] @@ -1833,11 +1833,11 @@ FROM [JoinOneToTwo] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s1].[OneId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s1].[OneId], [s1].[Id] """, // """ -SELECT [s2].[EntityBranchId], [s2].[EntityOneId], [s2].[Id], [s2].[Name], [s2].[Number], [s2].[IsGreen], [s2].[Discriminator], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [s2].[EntityBranchId], [s2].[EntityOneId], [s2].[Id], [s2].[Name], [s2].[Number], [s2].[IsGreen], [s2].[Discriminator], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id] @@ -1857,7 +1857,7 @@ FROM [Leaves] AS [l] ) AS [u] ON [j1].[EntityBranchId] = [u].[Id] WHERE [u].[Id] < 20 ) AS [s2] ON [s].[Id] = [s2].[EntityOneId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1881,11 +1881,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id] @@ -1898,7 +1898,7 @@ INNER JOIN ( FROM [EntityTwos] AS [e1] WHERE [e1].[Id] < 5 ) AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1960,7 +1960,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j0] INNER JOIN [EntityThrees] AS [e1] ON [j0].[ThreeId] = [e1].[Id] ) AS [s] ON [e0].[Id] = [s].[OneId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[OneId0], [s0].[ThreeId0] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[OneId0] """); } @@ -2117,7 +2117,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -2265,7 +2265,7 @@ FROM [UnidirectionalLeaves] AS [u4] ) AS [u1] ON [u0].[RootSkipSharedId] = [u1].[Id] WHERE [u1].[Discriminator] = N'UnidirectionalEntityLeaf' ) AS [s] ON [u].[Key1] = [s].[UnidirectionalEntityCompositeKeyKey1] AND [u].[Key2] = [s].[UnidirectionalEntityCompositeKeyKey2] AND [u].[Key3] = [s].[UnidirectionalEntityCompositeKeyKey3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s].[RootSkipSharedId], [s].[UnidirectionalEntityCompositeKeyKey1], [s].[UnidirectionalEntityCompositeKeyKey2], [s].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s].[RootSkipSharedId], [s].[UnidirectionalEntityCompositeKeyKey1], [s].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2424,7 +2424,7 @@ LEFT JOIN ( FROM [UnidirectionalJoinOneSelfPayload] AS [u0] INNER JOIN [UnidirectionalEntityOnes] AS [u1] ON [u0].[LeftId] = [u1].[Id] ) AS [s] ON [u].[Id] = [s].[RightId] -ORDER BY [u].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [u].[Id], [s].[LeftId] """); } @@ -2450,7 +2450,7 @@ UNION ALL FROM [UnidirectionalLeaves] AS [u4] ) AS [u1] ON [u0].[RootSkipSharedId] = [u1].[Id] ) AS [s] ON [u].[Key1] = [s].[UnidirectionalEntityCompositeKeyKey1] AND [u].[Key2] = [s].[UnidirectionalEntityCompositeKeyKey2] AND [u].[Key3] = [s].[UnidirectionalEntityCompositeKeyKey3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s].[RootSkipSharedId], [s].[UnidirectionalEntityCompositeKeyKey1], [s].[UnidirectionalEntityCompositeKeyKey2], [s].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s].[RootSkipSharedId], [s].[UnidirectionalEntityCompositeKeyKey1], [s].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2468,7 +2468,7 @@ FROM [UnidirectionalJoinOneToTwo] AS [u0] INNER JOIN [UnidirectionalEntityOnes] AS [u1] ON [u0].[OneId] = [u1].[Id] LEFT JOIN [UnidirectionalEntityTwos] AS [u2] ON [u1].[Id] = [u2].[ReferenceInverseId] ) AS [s] ON [u].[Id] = [s].[TwoId] -ORDER BY [u].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [u].[Id], [s].[OneId], [s].[TwoId] """); } @@ -2490,7 +2490,7 @@ FROM [UnidirectionalJoinOneToBranch] AS [u2] INNER JOIN [UnidirectionalEntityOnes] AS [u3] ON [u2].[UnidirectionalEntityOneId] = [u3].[Id] ) AS [s] ON [u1].[Id] = [s].[UnidirectionalEntityBranchId] ) AS [s0] ON [u].[Key1] = [s0].[CompositeId1] AND [u].[Key2] = [s0].[CompositeId2] AND [u].[Key3] = [s0].[CompositeId3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id], [s0].[UnidirectionalEntityBranchId], [s0].[UnidirectionalEntityOneId] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[UnidirectionalEntityBranchId] """); } @@ -2513,7 +2513,7 @@ FROM [UnidirectionalJoinOneSelfPayload] AS [u3] INNER JOIN [UnidirectionalEntityOnes] AS [u4] ON [u3].[RightId] = [u4].[Id] ) AS [s] ON [u1].[Id] = [s].[LeftId] ) AS [s0] ON [u].[Id] = [s0].[ThreeId] -ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -2531,7 +2531,7 @@ LEFT JOIN ( FROM [UnidirectionalEntityOneUnidirectionalEntityTwo] AS [u1] INNER JOIN [UnidirectionalEntityOnes] AS [u2] ON [u1].[UnidirectionalEntityOneId] = [u2].[Id] ) AS [s] ON [u].[Id] = [s].[TwoSkipSharedId] -ORDER BY [u].[Id], [u0].[Id], [s].[TwoSkipSharedId], [s].[UnidirectionalEntityOneId] +ORDER BY [u].[Id], [u0].[Id], [s].[TwoSkipSharedId] """); } @@ -2553,7 +2553,7 @@ FROM [UnidirectionalJoinOneToThreePayloadFullShared] AS [u2] INNER JOIN [UnidirectionalEntityThrees] AS [u3] ON [u2].[ThreeId] = [u3].[Id] ) AS [s] ON [u1].[Id] = [s].[OneId] ) AS [s0] ON [u].[Id] = [s0].[ThreeId] -ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[OneId0], [s0].[ThreeId0] +ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[OneId0] """); } @@ -2571,7 +2571,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -2674,7 +2674,7 @@ FROM [UnidirectionalEntityCompositeKeyUnidirectionalEntityTwo] AS [u2] ) AS [s] ON [u1].[Key1] = [s].[UnidirectionalEntityCompositeKeyKey1] AND [u1].[Key2] = [s].[UnidirectionalEntityCompositeKeyKey2] AND [u1].[Key3] = [s].[UnidirectionalEntityCompositeKeyKey3] WHERE [u1].[Key1] < 5 ) AS [s0] ON [u].[Id] = [s0].[LeafId] -ORDER BY [u].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2], [s0].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2694,7 +2694,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCRelationshipsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCRelationshipsQuerySqlServerTest.cs index e0f2c837098..826a6e4946f 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCRelationshipsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCRelationshipsQuerySqlServerTest.cs @@ -96,7 +96,7 @@ FROM [DerivedEntities] AS [d] LEFT JOIN [DerivedEntities] AS [d0] ON [u].[Id] = [d0].[Id] LEFT JOIN [OwnedCollections] AS [o0] ON [u].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [u].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [c].[Id], [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [c].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -144,7 +144,7 @@ FROM [DerivedEntities] AS [d] LEFT JOIN [OwnedCollections] AS [o0] ON [u].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [u].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [c].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -255,7 +255,7 @@ FROM [DerivedCollectionsOnDerived] AS [d] LEFT JOIN [OwnedReferences] AS [o] ON [d0].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [OwnedCollections] AS [o0] ON [d0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [d0].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [d0].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -284,7 +284,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [DerivedEntities] AS [d1] ON [u0].[Id] = [d1].[Id] LEFT JOIN [OwnedCollections] AS [o0] ON [u0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u0].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] """); } @@ -344,7 +344,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedCollections] AS [o0] ON [u0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u0].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] WHERE [u].[Name] <> N'Bar' OR [u].[Name] IS NULL -ORDER BY [u].[Id], [u0].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] """); } @@ -415,7 +415,7 @@ FROM [ReferencesOnDerived] AS [r] LEFT JOIN [OwnedReferences] AS [o] ON [d].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [OwnedCollections] AS [o0] ON [d].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d0] ON [d].[Id] = [d0].[DerivedInheritanceRelationshipEntityId] -ORDER BY [r].[Id], [d].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] +ORDER BY [r].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] """); } @@ -438,7 +438,7 @@ FROM [DerivedEntities] AS [d] LEFT JOIN [DerivedEntities] AS [d0] ON [u].[Id] = [d0].[Id] LEFT JOIN [OwnedCollections] AS [o0] ON [u].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [u].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [r].[Id], [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [r].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -486,7 +486,7 @@ FROM [DerivedEntities] AS [d] LEFT JOIN [OwnedCollections] AS [o0] ON [u].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [u].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] WHERE [r].[Name] <> N'Bar' OR [r].[Name] IS NULL -ORDER BY [r].[Id], [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [r].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -597,7 +597,7 @@ FROM [DerivedReferencesOnDerived] AS [d] LEFT JOIN [OwnedReferences] AS [o] ON [d0].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [OwnedCollections] AS [o0] ON [d0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [d0].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [d0].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -683,7 +683,7 @@ FROM [DerivedReferencesOnDerived] AS [d] LEFT JOIN [OwnedCollections] AS [o0] ON [d0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [d0].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] WHERE [u].[Name] <> N'Bar' OR [u].[Name] IS NULL -ORDER BY [u].[Id], [d0].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -712,7 +712,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [DerivedEntities] AS [d1] ON [u0].[Id] = [d1].[Id] LEFT JOIN [OwnedCollections] AS [o0] ON [u0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u0].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] """); } @@ -772,7 +772,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedCollections] AS [o0] ON [u0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u0].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] WHERE [u].[Name] <> N'Bar' OR [u].[Name] IS NULL -ORDER BY [u].[Id], [u0].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] """); } @@ -808,7 +808,7 @@ public override async Task Include_self_reference_with_inheritance_reverse(bool AssertSql( """ -SELECT [d].[Id], [d].[Name], [d].[BaseId], [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [o].[Id], [o].[Name], [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [u].[Name], [u].[BaseId], [u].[Discriminator], [o2].[BaseInheritanceRelationshipEntityId], [o2].[Id], [o2].[Name], [o0].[Id], [o0].[Name], [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [d1].[OwnedReferenceOnDerived_Id], [d1].[OwnedReferenceOnDerived_Name] +SELECT [d].[Id], [d].[Name], [d].[BaseId], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [o].[Id], [o].[Name], [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [u].[Id], [u].[Name], [u].[BaseId], [u].[Discriminator], [o2].[BaseInheritanceRelationshipEntityId], [o2].[Id], [o2].[Name], [o0].[Id], [o0].[Name], [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [d1].[OwnedReferenceOnDerived_Id], [d1].[OwnedReferenceOnDerived_Name] FROM [DerivedEntities] AS [d] LEFT JOIN ( SELECT [b].[Id], [b].[Name], NULL AS [BaseId], N'BaseInheritanceRelationshipEntity' AS [Discriminator] @@ -824,7 +824,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [d].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] LEFT JOIN [OwnedCollections] AS [o2] ON [u].[Id] = [o2].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d3] ON [u].[Id] = [d3].[DerivedInheritanceRelationshipEntityId] -ORDER BY [d].[Id], [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [o2].[BaseInheritanceRelationshipEntityId], [o2].[Id], [d3].[DerivedInheritanceRelationshipEntityId] +ORDER BY [d].[Id], [o].[BaseInheritanceRelationshipEntityId], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [o2].[BaseInheritanceRelationshipEntityId], [o2].[Id], [d3].[DerivedInheritanceRelationshipEntityId] """); } @@ -841,7 +841,7 @@ LEFT JOIN ( FROM [PrincipalEntities] AS [p] LEFT JOIN [ReferencedEntities] AS [r0] ON [p].[ReferenceId] = [r0].[Id] ) AS [s] ON [r].[Id] = [s].[ReferencedEntityId] -ORDER BY [r].[Id], [s].[Id] +ORDER BY [r].[Id] """); } @@ -916,7 +916,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [DerivedEntities] AS [d1] ON [u1].[Id] = [d1].[Id] LEFT JOIN [OwnedCollections] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u1].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] """); } @@ -991,7 +991,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [DerivedEntities] AS [d1] ON [u1].[Id] = [d1].[Id] LEFT JOIN [OwnedCollections] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u1].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] """); } @@ -1092,7 +1092,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [DerivedEntities] AS [d1] ON [u1].[Id] = [d1].[Id] LEFT JOIN [OwnedCollections] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u1].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] """); } @@ -1193,7 +1193,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [DerivedEntities] AS [d1] ON [u1].[Id] = [d1].[Id] LEFT JOIN [OwnedCollections] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u1].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [o0].[Id], [d2].[DerivedInheritanceRelationshipEntityId] """); } @@ -1340,11 +1340,11 @@ FROM [DerivedEntities] AS [d0] ) AS [u0] ON [u].[BaseParentId] = [u0].[Id] LEFT JOIN [OwnedReferences] AS [o] ON [u0].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d1] ON [u0].[Id] = [d1].[Id] -ORDER BY [u].[Id], [u0].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] """, // """ -SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [u0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [b].[Id], [b].[BaseParentId] FROM [BaseCollectionsOnBase] AS [b] @@ -1362,11 +1362,11 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedReferences] AS [o0] ON [u0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d2] ON [u0].[Id] = [d2].[Id] INNER JOIN [OwnedCollections] AS [o1] ON [u0].[Id] = [o1].[BaseInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """, // """ -SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [u0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [b].[Id], [b].[BaseParentId] FROM [BaseCollectionsOnBase] AS [b] @@ -1384,7 +1384,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedReferences] AS [o0] ON [u0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d2] ON [u0].[Id] = [d2].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d3] ON [u0].[Id] = [d3].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """); } @@ -1487,11 +1487,11 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedReferences] AS [o] ON [u0].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d1] ON [u0].[Id] = [d1].[Id] WHERE [u].[Name] <> N'Bar' OR [u].[Name] IS NULL -ORDER BY [u].[Id], [u0].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] """, // """ -SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [u0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [b].[Id], [b].[BaseParentId], [b].[Name] FROM [BaseCollectionsOnBase] AS [b] @@ -1510,11 +1510,11 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [DerivedEntities] AS [d2] ON [u0].[Id] = [d2].[Id] INNER JOIN [OwnedCollections] AS [o1] ON [u0].[Id] = [o1].[BaseInheritanceRelationshipEntityId] WHERE [u].[Name] <> N'Bar' OR [u].[Name] IS NULL -ORDER BY [u].[Id], [u0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """, // """ -SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [u0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [b].[Id], [b].[BaseParentId], [b].[Name] FROM [BaseCollectionsOnBase] AS [b] @@ -1533,7 +1533,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [DerivedEntities] AS [d2] ON [u0].[Id] = [d2].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d3] ON [u0].[Id] = [d3].[DerivedInheritanceRelationshipEntityId] WHERE [u].[Name] <> N'Bar' OR [u].[Name] IS NULL -ORDER BY [u].[Id], [u0].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """); } @@ -1619,11 +1619,11 @@ FROM [DerivedEntities] AS [d] ) AS [u] ON [c].[ParentId] = [u].[Id] LEFT JOIN [OwnedReferences] AS [o] ON [u].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d0] ON [u].[Id] = [d0].[Id] -ORDER BY [c].[Id], [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id] +ORDER BY [c].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id] """, // """ -SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [c].[Id], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] +SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [c].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN ( SELECT [b].[Id] @@ -1635,11 +1635,11 @@ FROM [DerivedEntities] AS [d] LEFT JOIN [OwnedReferences] AS [o0] ON [u].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d1] ON [u].[Id] = [d1].[Id] INNER JOIN [OwnedCollections] AS [o1] ON [u].[Id] = [o1].[BaseInheritanceRelationshipEntityId] -ORDER BY [c].[Id], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] +ORDER BY [c].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] """, // """ -SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [c].[Id], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] +SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [c].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN ( SELECT [b].[Id] @@ -1651,7 +1651,7 @@ FROM [DerivedEntities] AS [d] LEFT JOIN [OwnedReferences] AS [o0] ON [u].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d1] ON [u].[Id] = [d1].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [c].[Id], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] +ORDER BY [c].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] """); } @@ -1742,11 +1742,11 @@ FROM [DerivedEntities] AS [d] LEFT JOIN [OwnedReferences] AS [o] ON [u].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d0] ON [u].[Id] = [d0].[Id] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id] +ORDER BY [c].[Id], [o].[BaseInheritanceRelationshipEntityId], [d0].[Id] """, // """ -SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [c].[Id], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] +SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [c].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN ( SELECT [b].[Id] @@ -1759,11 +1759,11 @@ FROM [DerivedEntities] AS [d] LEFT JOIN [DerivedEntities] AS [d1] ON [u].[Id] = [d1].[Id] INNER JOIN [OwnedCollections] AS [o1] ON [u].[Id] = [o1].[BaseInheritanceRelationshipEntityId] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] +ORDER BY [c].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] """, // """ -SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [c].[Id], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] +SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [c].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN ( SELECT [b].[Id] @@ -1776,7 +1776,7 @@ FROM [DerivedEntities] AS [d] LEFT JOIN [DerivedEntities] AS [d1] ON [u].[Id] = [d1].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [u].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] +ORDER BY [c].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d1].[Id] """); } @@ -1918,11 +1918,11 @@ FROM [DerivedCollectionsOnDerived] AS [d] ) AS [u] LEFT JOIN [DerivedEntities] AS [d0] ON [u].[ParentId] = [d0].[Id] LEFT JOIN [OwnedReferences] AS [o] ON [d0].[Id] = [o].[BaseInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [d0].[Id], [o].[BaseInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId] """, // """ -SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId] +SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId] FROM ( SELECT [b].[Id], [b].[ParentId] FROM [BaseCollectionsOnDerived] AS [b] @@ -1933,11 +1933,11 @@ FROM [DerivedCollectionsOnDerived] AS [d] LEFT JOIN [DerivedEntities] AS [d0] ON [u].[ParentId] = [d0].[Id] LEFT JOIN [OwnedReferences] AS [o0] ON [d0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] INNER JOIN [OwnedCollections] AS [o1] ON [d0].[Id] = [o1].[BaseInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId] """, // """ -SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [u].[Id], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId] +SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId] FROM ( SELECT [b].[Id], [b].[ParentId] FROM [BaseCollectionsOnDerived] AS [b] @@ -1948,7 +1948,7 @@ FROM [DerivedCollectionsOnDerived] AS [d] LEFT JOIN [DerivedEntities] AS [d0] ON [u].[ParentId] = [d0].[Id] LEFT JOIN [OwnedReferences] AS [o0] ON [d0].[Id] = [o0].[BaseInheritanceRelationshipEntityId] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [d0].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [d0].[Id], [o0].[BaseInheritanceRelationshipEntityId] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId] """); } @@ -2152,11 +2152,11 @@ FROM [DerivedEntities] AS [d0] ) AS [u1] ON [u0].[BaseParentId] = [u1].[Id] LEFT JOIN [OwnedReferences] AS [o] ON [u1].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d1] ON [u1].[Id] = [d1].[Id] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] """, // """ -SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [n].[Id], [n].[ParentReferenceId] FROM [NestedCollections] AS [n] @@ -2181,11 +2181,11 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedReferences] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d2] ON [u1].[Id] = [d2].[Id] INNER JOIN [OwnedCollections] AS [o1] ON [u1].[Id] = [o1].[BaseInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """, // """ -SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [n].[Id], [n].[ParentReferenceId] FROM [NestedCollections] AS [n] @@ -2210,7 +2210,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedReferences] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d2] ON [u1].[Id] = [d2].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d3] ON [u1].[Id] = [d3].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """); } @@ -2325,11 +2325,11 @@ FROM [DerivedEntities] AS [d0] ) AS [u1] ON [u0].[BaseParentId] = [u1].[Id] LEFT JOIN [OwnedReferences] AS [o] ON [u1].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d1] ON [u1].[Id] = [d1].[Id] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] """, // """ -SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [n].[Id], [n].[ParentCollectionId] FROM [NestedReferences] AS [n] @@ -2354,11 +2354,11 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedReferences] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d2] ON [u1].[Id] = [d2].[Id] INNER JOIN [OwnedCollections] AS [o1] ON [u1].[Id] = [o1].[BaseInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """, // """ -SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [n].[Id], [n].[ParentCollectionId] FROM [NestedReferences] AS [n] @@ -2383,7 +2383,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedReferences] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d2] ON [u1].[Id] = [d2].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d3] ON [u1].[Id] = [d3].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """); } @@ -2516,11 +2516,11 @@ FROM [DerivedEntities] AS [d0] ) AS [u1] ON [u0].[BaseParentId] = [u1].[Id] LEFT JOIN [OwnedReferences] AS [o] ON [u1].[Id] = [o].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d1] ON [u1].[Id] = [d1].[Id] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] +ORDER BY [u].[Id], [o].[BaseInheritanceRelationshipEntityId], [d1].[Id] """, // """ -SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [o1].[BaseInheritanceRelationshipEntityId], [o1].[Id], [o1].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [n].[Id], [n].[ParentCollectionId] FROM [NestedCollections] AS [n] @@ -2545,11 +2545,11 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedReferences] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d2] ON [u1].[Id] = [d2].[Id] INNER JOIN [OwnedCollections] AS [o1] ON [u1].[Id] = [o1].[BaseInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """, // """ -SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +SELECT [d3].[DerivedInheritanceRelationshipEntityId], [d3].[Id], [d3].[Name], [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] FROM ( SELECT [n].[Id], [n].[ParentCollectionId] FROM [NestedCollections] AS [n] @@ -2574,7 +2574,7 @@ FROM [DerivedEntities] AS [d0] LEFT JOIN [OwnedReferences] AS [o0] ON [u1].[Id] = [o0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities] AS [d2] ON [u1].[Id] = [d2].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d3] ON [u1].[Id] = [d3].[DerivedInheritanceRelationshipEntityId] -ORDER BY [u].[Id], [u0].[Id], [u1].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] +ORDER BY [u].[Id], [o0].[BaseInheritanceRelationshipEntityId], [d2].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTGearsOfWarQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTGearsOfWarQuerySqlServerTest.cs index 701b86327e1..772bd7a804c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTGearsOfWarQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTGearsOfWarQuerySqlServerTest.cs @@ -62,7 +62,7 @@ FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] ) AS [s] ON [t].[GearNickName] = [s].[Nickname] AND [t].[GearSquadId] = [s].[SquadId] LEFT JOIN [Weapons] AS [w] ON [s].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [s].[Nickname], [s].[SquadId] +ORDER BY [t].[Id] """); } @@ -104,7 +104,7 @@ END AS [Discriminator] FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o0] ON [g0].[Nickname] = [o0].[Nickname] AND [g0].[SquadId] = [o0].[SquadId] ) AS [s] ON [c].[Name] = [s].[AssignedCityName] -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name], [s].[Nickname] +ORDER BY [g].[Nickname], [g].[SquadId], [s].[Nickname] """); } @@ -128,7 +128,7 @@ FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o0] ON [g0].[Nickname] = [o0].[Nickname] AND [g0].[SquadId] = [o0].[SquadId] ) AS [s] ON [c].[Name] = [s].[AssignedCityName] WHERE [g].[Nickname] = N'Marcus' -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name], [s].[Nickname] +ORDER BY [g].[Nickname], [g].[SquadId], [s].[Nickname] """); } @@ -282,7 +282,7 @@ FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] ) AS [s] ON [t].[GearSquadId] = [s].[SquadId] AND [t].[GearNickName] = [s].[Nickname] LEFT JOIN [Weapons] AS [w] ON [s].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [s].[Nickname], [s].[SquadId] +ORDER BY [t].[Id] """); } @@ -403,7 +403,7 @@ END AS [Discriminator] FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o0] ON [g0].[Nickname] = [o0].[Nickname] AND [g0].[SquadId] = [o0].[SquadId] ) AS [s] ON [c].[Name] = [s].[AssignedCityName] -ORDER BY [g].[Nickname], [g].[SquadId], [t].[Id], [c].[Name], [s].[Nickname] +ORDER BY [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Nickname] """); } @@ -450,7 +450,7 @@ END AS [Discriminator] FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o0] ON [g0].[Nickname] = [o0].[Nickname] AND [g0].[SquadId] = [o0].[SquadId] ) AS [s0] ON [s].[Nickname] = [s0].[LeaderNickname] AND [s].[SquadId] = [s0].[LeaderSquadId] -ORDER BY [s].[HasSoulPatch], [s].[Nickname] DESC, [t].[Id], [s].[SquadId], [s0].[Nickname] +ORDER BY [s].[HasSoulPatch], [s].[Nickname] DESC, [t].[Id], [s0].[Nickname] """); } @@ -495,7 +495,7 @@ END AS [Discriminator] FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o0] ON [g0].[Nickname] = [o0].[Nickname] AND [g0].[SquadId] = [o0].[SquadId] ) AS [s0] ON [s].[Nickname] = [s0].[LeaderNickname] AND [s].[SquadId] = [s0].[LeaderSquadId] -ORDER BY [t].[Id], [s].[Nickname], [s].[SquadId], [s0].[Nickname] +ORDER BY [t].[Id], [s0].[Nickname] """); } @@ -1705,11 +1705,6 @@ FROM [Gears] AS [g] WHERE [g].[HasSoulPatch] = CAST(1 AS bit) AND ( SELECT TOP(1) [w].[IsAutomatic] FROM [Weapons] AS [w] - LEFT JOIN ( - SELECT [w0].[Id] - FROM [Weapons] AS [w0] - WHERE [g].[FullName] = [w0].[OwnerFullName] - ) AS [w1] ON [w].[Id] = [w1].[Id] WHERE [g].[FullName] = [w].[OwnerFullName] ORDER BY [w].[Id]) = CAST(1 AS bit) """); @@ -2691,7 +2686,7 @@ public override async Task Select_correlated_filtered_collection(bool async) AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [c].[Name], [w0].[Id], [w0].[AmmunitionType], [w0].[IsAutomatic], [w0].[Name], [w0].[OwnerFullName], [w0].[SynergyWithId] +SELECT [g].[Nickname], [g].[SquadId], [w0].[Id], [w0].[AmmunitionType], [w0].[IsAutomatic], [w0].[Name], [w0].[OwnerFullName], [w0].[SynergyWithId] FROM [Gears] AS [g] INNER JOIN [Cities] AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN ( @@ -2700,7 +2695,7 @@ FROM [Weapons] AS [w] WHERE [w].[Name] <> N'Lancer' OR [w].[Name] IS NULL ) AS [w0] ON [g].[FullName] = [w0].[OwnerFullName] WHERE [c].[Name] IN (N'Ephyra', N'Hanover') -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -3434,7 +3429,7 @@ FROM [LocustLeaders] AS [l2] LEFT JOIN [LocustCommanders] AS [l3] ON [l2].[Name] = [l3].[Name] ) AS [s0] ON [f].[Id] = [s0].[LocustHordeId] WHERE [l].[Id] IS NOT NULL -ORDER BY [f].[Name], [f].[Id], [s].[Name] +ORDER BY [f].[Name], [f].[Id] """); } @@ -3607,7 +3602,7 @@ public override async Task Project_collection_navigation_with_inheritance1(bool AssertSql( """ -SELECT [f].[Id], [s].[Name], [s0].[Id], [s1].[Name], [s1].[LocustHordeId], [s1].[ThreatLevel], [s1].[ThreatLevelByte], [s1].[ThreatLevelNullableByte], [s1].[DefeatedByNickname], [s1].[DefeatedBySquadId], [s1].[HighCommandId], [s1].[Discriminator] +SELECT [f].[Id], [s0].[Id], [s1].[Name], [s1].[LocustHordeId], [s1].[ThreatLevel], [s1].[ThreatLevelByte], [s1].[ThreatLevelNullableByte], [s1].[DefeatedByNickname], [s1].[DefeatedBySquadId], [s1].[HighCommandId], [s1].[Discriminator] FROM [Factions] AS [f] LEFT JOIN [LocustHordes] AS [l] ON [f].[Id] = [l].[Id] LEFT JOIN ( @@ -3628,7 +3623,7 @@ FROM [LocustLeaders] AS [l3] LEFT JOIN [LocustCommanders] AS [l4] ON [l3].[Name] = [l4].[Name] ) AS [s1] ON [s0].[Id] = [s1].[LocustHordeId] WHERE [l].[Id] IS NOT NULL -ORDER BY [f].[Id], [s].[Name], [s0].[Id] +ORDER BY [f].[Id], [s0].[Id] """); } @@ -3638,7 +3633,7 @@ public override async Task Project_collection_navigation_with_inheritance2(bool AssertSql( """ -SELECT [f].[Id], [s].[Name], [s0].[Nickname], [s0].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[AssignedCityName], [s1].[CityOfBirthName], [s1].[FullName], [s1].[HasSoulPatch], [s1].[LeaderNickname], [s1].[LeaderSquadId], [s1].[Rank], [s1].[Discriminator] +SELECT [f].[Id], [s1].[Nickname], [s1].[SquadId], [s1].[AssignedCityName], [s1].[CityOfBirthName], [s1].[FullName], [s1].[HasSoulPatch], [s1].[LeaderNickname], [s1].[LeaderSquadId], [s1].[Rank], [s1].[Discriminator] FROM [Factions] AS [f] LEFT JOIN [LocustHordes] AS [l] ON [f].[Id] = [l].[Id] LEFT JOIN ( @@ -3658,7 +3653,7 @@ FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o] ON [g0].[Nickname] = [o].[Nickname] AND [g0].[SquadId] = [o].[SquadId] ) AS [s1] ON ([s0].[Nickname] = [s1].[LeaderNickname] OR ([s0].[Nickname] IS NULL AND [s1].[LeaderNickname] IS NULL)) AND [s0].[SquadId] = [s1].[LeaderSquadId] WHERE [l].[Id] IS NOT NULL -ORDER BY [f].[Id], [s].[Name], [s0].[Nickname], [s0].[SquadId], [s1].[Nickname] +ORDER BY [f].[Id], [s1].[Nickname] """); } @@ -3668,7 +3663,7 @@ public override async Task Project_collection_navigation_with_inheritance3(bool AssertSql( """ -SELECT [f].[Id], [s].[Name], [s0].[Nickname], [s0].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[AssignedCityName], [s1].[CityOfBirthName], [s1].[FullName], [s1].[HasSoulPatch], [s1].[LeaderNickname], [s1].[LeaderSquadId], [s1].[Rank], [s1].[Discriminator] +SELECT [f].[Id], [s1].[Nickname], [s1].[SquadId], [s1].[AssignedCityName], [s1].[CityOfBirthName], [s1].[FullName], [s1].[HasSoulPatch], [s1].[LeaderNickname], [s1].[LeaderSquadId], [s1].[Rank], [s1].[Discriminator] FROM [Factions] AS [f] LEFT JOIN [LocustHordes] AS [l] ON [f].[Id] = [l].[Id] LEFT JOIN ( @@ -3688,7 +3683,7 @@ FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o] ON [g0].[Nickname] = [o].[Nickname] AND [g0].[SquadId] = [o].[SquadId] ) AS [s1] ON ([s0].[Nickname] = [s1].[LeaderNickname] OR ([s0].[Nickname] IS NULL AND [s1].[LeaderNickname] IS NULL)) AND [s0].[SquadId] = [s1].[LeaderSquadId] WHERE [l].[Id] IS NOT NULL -ORDER BY [f].[Id], [s].[Name], [s0].[Nickname], [s0].[SquadId], [s1].[Nickname] +ORDER BY [f].[Id], [s1].[Nickname] """); } @@ -3761,7 +3756,7 @@ FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o0] ON [g0].[Nickname] = [o0].[Nickname] AND [g0].[SquadId] = [o0].[SquadId] INNER JOIN [Cities] AS [c] ON [g0].[CityOfBirthName] = [c].[Name] ) AS [s0] ON ([s].[Nickname] = [s0].[LeaderNickname] OR ([s].[Nickname] IS NULL AND [s0].[LeaderNickname] IS NULL)) AND [s].[SquadId] = [s0].[LeaderSquadId] -ORDER BY [l].[Name], [s].[Nickname], [s].[SquadId], [s0].[Nickname], [s0].[SquadId] +ORDER BY [l].[Name], [s0].[Nickname] """); } @@ -3927,7 +3922,7 @@ FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] ) AS [s] ON [t].[GearNickName] = [s].[Nickname] AND [t].[GearSquadId] = [s].[SquadId] LEFT JOIN [Weapons] AS [w] ON [s].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [s].[Nickname], [s].[SquadId] +ORDER BY [t].[Id] """); } @@ -3961,7 +3956,7 @@ END AS [Discriminator] FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o0] ON [g0].[Nickname] = [o0].[Nickname] AND [g0].[SquadId] = [o0].[SquadId] ) AS [s1] ON ([s0].[Nickname] = [s1].[LeaderNickname] OR ([s0].[Nickname] IS NULL AND [s1].[LeaderNickname] IS NULL)) AND [s0].[SquadId] = [s1].[LeaderSquadId] -ORDER BY [f].[Id], [s].[Name], [s0].[Nickname], [s0].[SquadId], [s1].[Nickname] +ORDER BY [f].[Id], [s1].[Nickname] """); } @@ -4019,7 +4014,7 @@ FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] ) AS [s] ON [l1].[DefeatedByNickname] = [s].[Nickname] AND [l1].[DefeatedBySquadId] = [s].[SquadId] ) AS [s0] ON [f].[Id] = [s0].[LocustHordeId] -ORDER BY [f].[Id], [s0].[Name], [s0].[Nickname] +ORDER BY [f].[Id] """); } @@ -4053,7 +4048,7 @@ END AS [Discriminator] FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o0] ON [g0].[Nickname] = [o0].[Nickname] AND [g0].[SquadId] = [o0].[SquadId] ) AS [s1] ON ([s0].[Nickname] = [s1].[LeaderNickname] OR ([s0].[Nickname] IS NULL AND [s1].[LeaderNickname] IS NULL)) AND [s0].[SquadId] = [s1].[LeaderSquadId] -ORDER BY [f].[Id], [s].[Name], [s0].[Nickname], [s0].[SquadId], [s1].[Nickname] +ORDER BY [f].[Id], [s1].[Nickname] """); } @@ -4077,7 +4072,7 @@ FROM [Gears] AS [g0] INNER JOIN [Squads] AS [s] ON [g0].[SquadId] = [s].[Id] LEFT JOIN [SquadMissions] AS [s0] ON [s].[Id] = [s0].[SquadId] ) AS [s1] ON [g].[Nickname] = [s1].[LeaderNickname] AND [g].[SquadId] = [s1].[LeaderSquadId] -ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[SquadId0] +ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[SquadId0] """); } @@ -4359,7 +4354,7 @@ public override async Task Correlated_collections_projection_of_collection_thru_ AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [s].[Id], [s1].[SquadId], [s1].[MissionId] +SELECT [g].[Nickname], [g].[SquadId], [s1].[SquadId], [s1].[MissionId] FROM [Gears] AS [g] INNER JOIN [Squads] AS [s] ON [g].[SquadId] = [s].[Id] LEFT JOIN ( @@ -4368,7 +4363,7 @@ FROM [SquadMissions] AS [s0] WHERE [s0].[MissionId] <> 17 ) AS [s1] ON [s].[Id] = [s1].[SquadId] WHERE [g].[Nickname] <> N'Marcus' -ORDER BY [g].[FullName], [g].[Nickname], [g].[SquadId], [s].[Id], [s1].[SquadId] +ORDER BY [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[SquadId] """); } @@ -4395,10 +4390,10 @@ public override async Task Correlated_collections_nested(bool async) AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0] FROM [Squads] AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] FROM [SquadMissions] AS [s0] INNER JOIN [Missions] AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -4408,7 +4403,7 @@ WHERE [s1].[SquadId] < 7 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 42 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -4418,10 +4413,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0] FROM [Squads] AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] FROM [SquadMissions] AS [s0] INNER JOIN [Missions] AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -4431,7 +4426,7 @@ WHERE [s1].[SquadId] < 2 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 3 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -4441,10 +4436,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0] FROM [Squads] AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0] FROM [SquadMissions] AS [s0] INNER JOIN [Missions] AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -4454,7 +4449,7 @@ WHERE [s1].[SquadId] < 7 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 42 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -4573,7 +4568,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId], [s1].[Nickname], [s1].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId], [s1].[Nickname], [s1].[SquadId] FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] LEFT JOIN [Tags] AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] @@ -4593,7 +4588,7 @@ WHERE [o].[Nickname] IS NOT NULL AND EXISTS ( SELECT 1 FROM [Gears] AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[IsAutomatic], [s1].[Nickname] DESC, [s1].[Id] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[IsAutomatic], [s1].[Nickname] DESC, [s1].[Id] """); } @@ -4604,7 +4599,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId], [s1].[Nickname], [s1].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId], [s1].[Nickname], [s1].[SquadId] FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] LEFT JOIN [Tags] AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] @@ -4624,7 +4619,7 @@ WHERE [o].[Nickname] IS NOT NULL AND EXISTS ( SELECT 1 FROM [Gears] AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[IsAutomatic], [s1].[Nickname] DESC, [s1].[Id] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[IsAutomatic], [s1].[Nickname] DESC, [s1].[Id] """); } @@ -4635,7 +4630,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId], [s1].[Nickname], [s1].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId], [s1].[Nickname], [s1].[SquadId] FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] LEFT JOIN [Tags] AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] @@ -4658,7 +4653,7 @@ WHERE [o].[Nickname] IS NOT NULL AND EXISTS ( SELECT 1 FROM [Gears] AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[Id] DESC, [s1].[c], [s1].[Nickname] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[Id] DESC, [s1].[c], [s1].[Nickname] """); } @@ -4668,7 +4663,7 @@ public override async Task Correlated_collections_multiple_nested_complex_collec AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Nickname], [s].[SquadId], [s5].[FullName], [s5].[Nickname], [s5].[SquadId], [s5].[Id], [s5].[Nickname0], [s5].[SquadId0], [s5].[Id0], [s5].[Name], [s5].[IsAutomatic], [s5].[Id1], [s5].[Nickname00], [s5].[HasSoulPatch], [s5].[SquadId00], [s6].[Id], [s6].[AmmunitionType], [s6].[IsAutomatic], [s6].[Name], [s6].[OwnerFullName], [s6].[SynergyWithId], [s6].[Nickname], [s6].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s5].[FullName], [s5].[Nickname], [s5].[SquadId], [s5].[Id], [s5].[Nickname0], [s5].[SquadId0], [s5].[Name], [s5].[IsAutomatic], [s5].[Id0], [s5].[Nickname00], [s5].[HasSoulPatch], [s5].[SquadId00], [s6].[Id], [s6].[AmmunitionType], [s6].[IsAutomatic], [s6].[Name], [s6].[OwnerFullName], [s6].[SynergyWithId], [s6].[Nickname], [s6].[SquadId] FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] LEFT JOIN [Tags] AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] @@ -4677,10 +4672,10 @@ LEFT JOIN ( FROM [Gears] AS [g1] ) AS [s] ON [t].[GearNickName] = [s].[Nickname] AND [t].[GearSquadId] = [s].[SquadId] LEFT JOIN ( - SELECT [g2].[FullName], [g2].[Nickname], [g2].[SquadId], [s4].[Id], [s4].[Nickname] AS [Nickname0], [s4].[SquadId] AS [SquadId0], [s4].[Id0], [s4].[Name], [s4].[IsAutomatic], [s4].[Id1], [s4].[Nickname0] AS [Nickname00], [s4].[HasSoulPatch], [s4].[SquadId0] AS [SquadId00], [g2].[Rank], [s4].[IsAutomatic0], [g2].[LeaderNickname], [g2].[LeaderSquadId] + SELECT [g2].[FullName], [g2].[Nickname], [g2].[SquadId], [s4].[Id], [s4].[Nickname] AS [Nickname0], [s4].[SquadId] AS [SquadId0], [s4].[Name], [s4].[IsAutomatic], [s4].[Id0], [s4].[Nickname0] AS [Nickname00], [s4].[HasSoulPatch], [s4].[SquadId0] AS [SquadId00], [g2].[Rank], [s4].[IsAutomatic0], [g2].[LeaderNickname], [g2].[LeaderSquadId] FROM [Gears] AS [g2] LEFT JOIN ( - SELECT [w].[Id], [s0].[Nickname], [s0].[SquadId], [s1].[Id] AS [Id0], [w0].[Name], [w0].[IsAutomatic], [w0].[Id] AS [Id1], [s3].[Nickname] AS [Nickname0], [s3].[HasSoulPatch], [s3].[SquadId] AS [SquadId0], [w].[IsAutomatic] AS [IsAutomatic0], [w].[OwnerFullName] + SELECT [w].[Id], [s0].[Nickname], [s0].[SquadId], [w0].[Name], [w0].[IsAutomatic], [w0].[Id] AS [Id0], [s3].[Nickname] AS [Nickname0], [s3].[HasSoulPatch], [s3].[SquadId] AS [SquadId0], [w].[IsAutomatic] AS [IsAutomatic0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g3].[Nickname], [g3].[SquadId], [g3].[FullName] @@ -4708,7 +4703,7 @@ WHERE [o].[Nickname] IS NOT NULL AND EXISTS ( SELECT 1 FROM [Gears] AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Nickname], [s].[SquadId], [s5].[Rank], [s5].[Nickname], [s5].[SquadId], [s5].[IsAutomatic0], [s5].[Id], [s5].[Nickname0], [s5].[SquadId0], [s5].[Id0], [s5].[Id1], [s5].[Nickname00], [s5].[SquadId00], [s6].[IsAutomatic], [s6].[Nickname] DESC, [s6].[Id] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s5].[Rank], [s5].[Nickname], [s5].[SquadId], [s5].[IsAutomatic0], [s5].[Id], [s5].[Nickname0], [s5].[SquadId0], [s5].[Id0], [s5].[Nickname00], [s5].[SquadId00], [s6].[IsAutomatic], [s6].[Nickname] DESC, [s6].[Id] """); } @@ -4990,7 +4985,7 @@ public override async Task Correlated_collections_deeply_nested_left_join(bool a AssertSql( """ -SELECT [t].[Id], [s].[Nickname], [s].[SquadId], [s0].[Id], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId] +SELECT [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId] FROM [Tags] AS [t] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId] @@ -5007,7 +5002,7 @@ FROM [Weapons] AS [w] ) AS [w0] ON [g0].[FullName] = [w0].[OwnerFullName] WHERE [g0].[HasSoulPatch] = CAST(1 AS bit) ) AS [s1] ON [s0].[Id] = [s1].[SquadId] -ORDER BY [t].[Note], [s].[Nickname] DESC, [t].[Id], [s].[SquadId], [s0].[Id], [s1].[Nickname], [s1].[SquadId] +ORDER BY [t].[Note], [s].[Nickname] DESC, [t].[Id], [s].[SquadId], [s1].[Nickname], [s1].[SquadId] """); } @@ -5017,7 +5012,7 @@ public override async Task Correlated_collections_from_left_join_with_additional AssertSql( """ -SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s0].[Id], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId], [s1].[Rank] +SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[AmmunitionType], [s1].[IsAutomatic], [s1].[Name], [s1].[OwnerFullName], [s1].[SynergyWithId], [s1].[Rank] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName] @@ -5033,7 +5028,7 @@ FROM [Weapons] AS [w0] WHERE [w0].[IsAutomatic] = CAST(0 AS bit) ) AS [w1] ON [g0].[FullName] = [w1].[OwnerFullName] ) AS [s1] ON [s0].[Id] = [s1].[SquadId] -ORDER BY [w].[Name], [w].[Id], [s].[Nickname], [s].[SquadId], [s0].[Id], [s1].[FullName] DESC, [s1].[Nickname], [s1].[SquadId], [s1].[Id] +ORDER BY [w].[Name], [w].[Id], [s].[Nickname], [s].[SquadId], [s1].[FullName] DESC, [s1].[Nickname], [s1].[SquadId], [s1].[Id] """); } @@ -5043,10 +5038,10 @@ public override async Task Correlated_collections_complex_scenario1(bool async) AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s2].[Id], [s2].[Nickname], [s2].[SquadId], [s2].[Id0], [s2].[Nickname0], [s2].[HasSoulPatch], [s2].[SquadId0] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s2].[Id], [s2].[Nickname], [s2].[SquadId], [s2].[Nickname0], [s2].[HasSoulPatch], [s2].[SquadId0] FROM [Gears] AS [g] LEFT JOIN ( - SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s0].[Id] AS [Id0], [s1].[Nickname] AS [Nickname0], [s1].[HasSoulPatch], [s1].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s1].[Nickname] AS [Nickname0], [s1].[HasSoulPatch], [s1].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g0].[Nickname], [g0].[SquadId], [g0].[FullName] @@ -5058,7 +5053,7 @@ LEFT JOIN ( FROM [Gears] AS [g1] ) AS [s1] ON [s0].[Id] = [s1].[SquadId] ) AS [s2] ON [g].[FullName] = [s2].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [s2].[Id], [s2].[Nickname], [s2].[SquadId], [s2].[Id0], [s2].[Nickname0] +ORDER BY [g].[Nickname], [g].[SquadId], [s2].[Id], [s2].[Nickname], [s2].[SquadId], [s2].[Nickname0] """); } @@ -5068,14 +5063,14 @@ public override async Task Correlated_collections_complex_scenario2(bool async) AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s3].[FullName], [s3].[Nickname], [s3].[SquadId], [s3].[Id], [s3].[Nickname0], [s3].[SquadId0], [s3].[Id0], [s3].[Nickname00], [s3].[HasSoulPatch], [s3].[SquadId00] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s3].[FullName], [s3].[Nickname], [s3].[SquadId], [s3].[Id], [s3].[Nickname0], [s3].[SquadId0], [s3].[Nickname00], [s3].[HasSoulPatch], [s3].[SquadId00] FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] LEFT JOIN ( - SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s2].[Id], [s2].[Nickname] AS [Nickname0], [s2].[SquadId] AS [SquadId0], [s2].[Id0], [s2].[Nickname0] AS [Nickname00], [s2].[HasSoulPatch], [s2].[SquadId0] AS [SquadId00], [g0].[LeaderNickname], [g0].[LeaderSquadId] + SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s2].[Id], [s2].[Nickname] AS [Nickname0], [s2].[SquadId] AS [SquadId0], [s2].[Nickname0] AS [Nickname00], [s2].[HasSoulPatch], [s2].[SquadId0] AS [SquadId00], [g0].[LeaderNickname], [g0].[LeaderSquadId] FROM [Gears] AS [g0] LEFT JOIN ( - SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s0].[Id] AS [Id0], [s1].[Nickname] AS [Nickname0], [s1].[HasSoulPatch], [s1].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s1].[Nickname] AS [Nickname0], [s1].[HasSoulPatch], [s1].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g1].[Nickname], [g1].[SquadId], [g1].[FullName] @@ -5089,7 +5084,7 @@ FROM [Gears] AS [g2] ) AS [s2] ON [g0].[FullName] = [s2].[OwnerFullName] ) AS [s3] ON [g].[Nickname] = [s3].[LeaderNickname] AND [g].[SquadId] = [s3].[LeaderSquadId] WHERE [o].[Nickname] IS NOT NULL -ORDER BY [g].[Nickname], [g].[SquadId], [s3].[Nickname], [s3].[SquadId], [s3].[Id], [s3].[Nickname0], [s3].[SquadId0], [s3].[Id0], [s3].[Nickname00] +ORDER BY [g].[Nickname], [g].[SquadId], [s3].[Nickname], [s3].[SquadId], [s3].[Id], [s3].[Nickname0], [s3].[SquadId0], [s3].[Nickname00] """); } @@ -5099,10 +5094,10 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s2].[Id], [s2].[Nickname], [s2].[SquadId], [s2].[Id0], [s2].[Nickname0], [s2].[HasSoulPatch], [s2].[SquadId0] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s2].[Id], [s2].[Nickname], [s2].[SquadId], [s2].[Nickname0], [s2].[HasSoulPatch], [s2].[SquadId0] FROM [Gears] AS [g] LEFT JOIN ( - SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s0].[Id] AS [Id0], [s1].[Nickname] AS [Nickname0], [s1].[HasSoulPatch], [s1].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s1].[Nickname] AS [Nickname0], [s1].[HasSoulPatch], [s1].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g0].[Nickname], [g0].[SquadId], [g0].[FullName] @@ -5114,7 +5109,7 @@ LEFT JOIN ( FROM [Gears] AS [g1] ) AS [s1] ON [s0].[Id] = [s1].[SquadId] ) AS [s2] ON [g].[FullName] = [s2].[OwnerFullName] -ORDER BY [g].[FullName], [g].[Nickname] DESC, [g].[SquadId], [s2].[Id], [s2].[Nickname], [s2].[SquadId], [s2].[Id0], [s2].[Nickname0] +ORDER BY [g].[FullName], [g].[Nickname] DESC, [g].[SquadId], [s2].[Id], [s2].[Nickname], [s2].[SquadId], [s2].[Nickname0] """); } @@ -5124,14 +5119,14 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s3].[FullName], [s3].[Nickname], [s3].[SquadId], [s3].[Id], [s3].[Nickname0], [s3].[SquadId0], [s3].[Id0], [s3].[Nickname00], [s3].[HasSoulPatch], [s3].[SquadId00] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s3].[FullName], [s3].[Nickname], [s3].[SquadId], [s3].[Id], [s3].[Nickname0], [s3].[SquadId0], [s3].[Nickname00], [s3].[HasSoulPatch], [s3].[SquadId00] FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] LEFT JOIN ( - SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s2].[Id], [s2].[Nickname] AS [Nickname0], [s2].[SquadId] AS [SquadId0], [s2].[Id0], [s2].[Nickname0] AS [Nickname00], [s2].[HasSoulPatch], [s2].[SquadId0] AS [SquadId00], [g0].[HasSoulPatch] AS [HasSoulPatch0], [s2].[IsAutomatic], [s2].[Name], [g0].[LeaderNickname], [g0].[LeaderSquadId] + SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s2].[Id], [s2].[Nickname] AS [Nickname0], [s2].[SquadId] AS [SquadId0], [s2].[Nickname0] AS [Nickname00], [s2].[HasSoulPatch], [s2].[SquadId0] AS [SquadId00], [g0].[HasSoulPatch] AS [HasSoulPatch0], [s2].[IsAutomatic], [s2].[Name], [g0].[LeaderNickname], [g0].[LeaderSquadId] FROM [Gears] AS [g0] LEFT JOIN ( - SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s0].[Id] AS [Id0], [s1].[Nickname] AS [Nickname0], [s1].[HasSoulPatch], [s1].[SquadId] AS [SquadId0], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName] + SELECT [w].[Id], [s].[Nickname], [s].[SquadId], [s1].[Nickname] AS [Nickname0], [s1].[HasSoulPatch], [s1].[SquadId] AS [SquadId0], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN ( SELECT [g1].[Nickname], [g1].[SquadId], [g1].[FullName] @@ -5145,7 +5140,7 @@ FROM [Gears] AS [g2] ) AS [s2] ON [g0].[FullName] = [s2].[OwnerFullName] ) AS [s3] ON [g].[Nickname] = [s3].[LeaderNickname] AND [g].[SquadId] = [s3].[LeaderSquadId] WHERE [o].[Nickname] IS NOT NULL -ORDER BY [g].[HasSoulPatch], [g].[LeaderNickname], [g].[FullName], [g].[Nickname], [g].[SquadId], [s3].[FullName], [s3].[HasSoulPatch0] DESC, [s3].[Nickname], [s3].[SquadId], [s3].[IsAutomatic], [s3].[Name] DESC, [s3].[Id], [s3].[Nickname0], [s3].[SquadId0], [s3].[Id0], [s3].[Nickname00] +ORDER BY [g].[HasSoulPatch], [g].[LeaderNickname], [g].[FullName], [g].[Nickname], [g].[SquadId], [s3].[FullName], [s3].[HasSoulPatch0] DESC, [s3].[Nickname], [s3].[SquadId], [s3].[IsAutomatic], [s3].[Name] DESC, [s3].[Id], [s3].[Nickname0], [s3].[SquadId0], [s3].[Nickname00] """); } @@ -5277,7 +5272,7 @@ LEFT JOIN [Tags] AS [t] ON ([s].[Nickname] = [t].[GearNickName] OR ([s].[Nicknam ORDER BY [t].[Note] ) AS [s0] LEFT JOIN [Weapons] AS [w] ON [s0].[FullName] = [w].[OwnerFullName] -ORDER BY [s0].[Note], [s0].[Name], [s0].[Nickname], [s0].[SquadId], [s0].[Id] +ORDER BY [s0].[Note], [s0].[Name], [s0].[Id] """); } @@ -6536,7 +6531,7 @@ LEFT JOIN ( FROM ( SELECT [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank], CASE WHEN [o].[Nickname] IS NOT NULL THEN N'Officer' - END AS [Discriminator], [c].[Name], [c].[Location], [c].[Nation], ROW_NUMBER() OVER(PARTITION BY [g0].[Rank] ORDER BY [g0].[Nickname], [g0].[SquadId], [c].[Name]) AS [row] + END AS [Discriminator], [c].[Name], [c].[Location], [c].[Nation], ROW_NUMBER() OVER(PARTITION BY [g0].[Rank] ORDER BY [g0].[Nickname], [g0].[SquadId]) AS [row] FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o] ON [g0].[Nickname] = [o].[Nickname] AND [g0].[SquadId] = [o].[SquadId] INNER JOIN [Cities] AS [c] ON [g0].[CityOfBirthName] = [c].[Name] @@ -7066,7 +7061,7 @@ public override async Task Project_collection_navigation_nested_with_take_compos AssertSql( """ -SELECT [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[AssignedCityName], [s1].[CityOfBirthName], [s1].[FullName], [s1].[HasSoulPatch], [s1].[LeaderNickname], [s1].[LeaderSquadId], [s1].[Rank], [s1].[Discriminator] +SELECT [t].[Id], [s1].[Nickname], [s1].[SquadId], [s1].[AssignedCityName], [s1].[CityOfBirthName], [s1].[FullName], [s1].[HasSoulPatch], [s1].[LeaderNickname], [s1].[LeaderSquadId], [s1].[Rank], [s1].[Discriminator] FROM [Tags] AS [t] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId], CASE @@ -7087,7 +7082,7 @@ FROM [Gears] AS [g0] WHERE [s0].[row] <= 50 ) AS [s1] ON ([s].[Nickname] = [s1].[LeaderNickname] OR ([s].[Nickname] IS NULL AND [s1].[LeaderNickname] IS NULL)) AND [s].[SquadId] = [s1].[LeaderSquadId] WHERE [s].[Discriminator] = N'Officer' -ORDER BY [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[Nickname] +ORDER BY [t].[Id], [s1].[Nickname] """); } @@ -7097,7 +7092,7 @@ public override async Task Project_collection_navigation_nested_composite_key(bo AssertSql( """ -SELECT [t].[Id], [s].[Nickname], [s].[SquadId], [s0].[Nickname], [s0].[SquadId], [s0].[AssignedCityName], [s0].[CityOfBirthName], [s0].[FullName], [s0].[HasSoulPatch], [s0].[LeaderNickname], [s0].[LeaderSquadId], [s0].[Rank], [s0].[Discriminator] +SELECT [t].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[AssignedCityName], [s0].[CityOfBirthName], [s0].[FullName], [s0].[HasSoulPatch], [s0].[LeaderNickname], [s0].[LeaderSquadId], [s0].[Rank], [s0].[Discriminator] FROM [Tags] AS [t] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId], CASE @@ -7114,7 +7109,7 @@ FROM [Gears] AS [g0] LEFT JOIN [Officers] AS [o0] ON [g0].[Nickname] = [o0].[Nickname] AND [g0].[SquadId] = [o0].[SquadId] ) AS [s0] ON ([s].[Nickname] = [s0].[LeaderNickname] OR ([s].[Nickname] IS NULL AND [s0].[LeaderNickname] IS NULL)) AND [s].[SquadId] = [s0].[LeaderSquadId] WHERE [s].[Discriminator] = N'Officer' -ORDER BY [t].[Id], [s].[Nickname], [s].[SquadId], [s0].[Nickname] +ORDER BY [t].[Id], [s0].[Nickname] """); } @@ -7406,14 +7401,14 @@ public override async Task Accessing_reference_navigation_collection_composition AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [s].[Id], [s].[IsAutomatic], [s].[Name], [s].[Id0] +SELECT [g].[Nickname], [g].[SquadId], [s].[Id], [s].[IsAutomatic], [s].[Name] FROM [Gears] AS [g] LEFT JOIN ( - SELECT [w].[Id], [w].[IsAutomatic], [w0].[Name], [w0].[Id] AS [Id0], [w].[OwnerFullName] + SELECT [w].[Id], [w].[IsAutomatic], [w0].[Name], [w].[OwnerFullName] FROM [Weapons] AS [w] LEFT JOIN [Weapons] AS [w0] ON [w].[SynergyWithId] = [w0].[Id] ) AS [s] ON [g].[FullName] = [s].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [s].[Id] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -7446,7 +7441,7 @@ public override async Task Accessing_property_of_optional_navigation_in_child_pr SELECT CASE WHEN [s].[Nickname] IS NOT NULL AND [s].[SquadId] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) -END, [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[Nickname], [s1].[Id], [s1].[SquadId] +END, [t].[Id], [s1].[Nickname], [s1].[Id], [s1].[SquadId] FROM [Tags] AS [t] LEFT JOIN ( SELECT [g].[Nickname], [g].[SquadId], [g].[FullName] @@ -7460,7 +7455,7 @@ LEFT JOIN ( FROM [Gears] AS [g0] ) AS [s0] ON [w].[OwnerFullName] = [s0].[FullName] ) AS [s1] ON [s].[FullName] = [s1].[OwnerFullName] -ORDER BY [t].[Note], [t].[Id], [s].[Nickname], [s].[SquadId], [s1].[Id], [s1].[Nickname] +ORDER BY [t].[Note], [t].[Id], [s1].[Id], [s1].[Nickname] """); } @@ -8705,7 +8700,7 @@ public override async Task Correlated_collection_take(bool async) AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [c].[Name], [w1].[Id], [w1].[AmmunitionType], [w1].[IsAutomatic], [w1].[Name], [w1].[OwnerFullName], [w1].[SynergyWithId], [c].[Location], [c].[Nation] +SELECT [g].[Nickname], [g].[SquadId], [w1].[Id], [w1].[AmmunitionType], [w1].[IsAutomatic], [w1].[Name], [w1].[OwnerFullName], [w1].[SynergyWithId], [c].[Name], [c].[Location], [c].[Nation] FROM [Gears] AS [g] INNER JOIN [Cities] AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN ( @@ -8716,7 +8711,7 @@ FROM [Weapons] AS [w] ) AS [w0] WHERE [w0].[row] <= 10 ) AS [w1] ON [g].[FullName] = [w1].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -9316,7 +9311,7 @@ FROM [Weapons] AS [w0] ) AS [w1] WHERE [w1].[row] <= 1 ) AS [w2] ON [g].[FullName] = [w2].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [s].[Id] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -9582,7 +9577,7 @@ FROM [Gears] AS [g] ) AS [s] ON [l0].[DefeatedByNickname] = [s].[Nickname] AND [l0].[DefeatedBySquadId] = [s].[SquadId] LEFT JOIN [Weapons] AS [w] ON [s].[FullName] = [w].[OwnerFullName] WHERE [l].[Name] LIKE N'%Queen%' -ORDER BY [l].[Name], [s].[Nickname], [s].[SquadId] +ORDER BY [l].[Name] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTManyToManyNoTrackingQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTManyToManyNoTrackingQuerySqlServerTest.cs index aeb9256d874..47bb498fc15 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTManyToManyNoTrackingQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTManyToManyNoTrackingQuerySqlServerTest.cs @@ -379,7 +379,7 @@ FROM [Roots] AS [r] INNER JOIN [Leaves] AS [l] ON [r].[Id] = [l].[Id] ) AS [s] ON [j].[LeafId] = [s].[Id] ) AS [s0] ON [e].[Key1] = [s0].[CompositeId1] AND [e].[Key2] = [s0].[CompositeId2] AND [e].[Key3] = [s0].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2] """); } @@ -407,7 +407,7 @@ FROM [Roots] AS [r] ) AS [s] ON [e0].[RootSkipSharedId] = [s].[Id] WHERE [s].[Discriminator] = N'EntityLeaf' ) AS [s0] ON [e].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s0].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[RootSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[RootSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -606,7 +606,7 @@ LEFT JOIN ( FROM [JoinOneSelfPayload] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[LeftId] = [e0].[Id] ) AS [s] ON [e].[Id] = [s].[RightId] -ORDER BY [e].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [e].[Id], [s].[LeftId] """); } @@ -633,7 +633,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e3] INNER JOIN [EntityCompositeKeys] AS [e4] ON [e3].[CompositeKeySkipSharedKey1] = [e4].[Key1] AND [e3].[CompositeKeySkipSharedKey2] = [e4].[Key2] AND [e3].[CompositeKeySkipSharedKey3] = [e4].[Key3] ) AS [s1] ON [e].[Id] = [s1].[TwoSkipSharedId] -ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s].[Id], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s0].[Id], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2] +ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2] """); } @@ -682,7 +682,7 @@ FROM [Roots] AS [r] LEFT JOIN [Leaf2s] AS [l0] ON [r].[Id] = [l0].[Id] ) AS [s] ON [e0].[RootSkipSharedId] = [s].[Id] ) AS [s0] ON [e].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s0].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[RootSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[RootSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -700,7 +700,7 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """); } @@ -727,7 +727,7 @@ FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e0] ON [j0].[EntityOneId] = [e0].[Id] ) AS [s0] ON [s].[Id] = [s0].[EntityBranchId] ) AS [s1] ON [e].[Key1] = [s1].[CompositeId1] AND [e].[Key2] = [s1].[CompositeId2] AND [e].[Key3] = [s1].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s1].[LeafId], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id], [s1].[EntityBranchId], [s1].[EntityOneId] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s1].[LeafId], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[EntityBranchId] """); } @@ -750,7 +750,7 @@ FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s] ON [e0].[Id] = [s].[LeftId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -768,7 +768,7 @@ LEFT JOIN ( FROM [EntityOneEntityTwo] AS [e1] INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] ) AS [s] ON [e].[Id] = [s].[TwoSkipSharedId] -ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId] """); } @@ -786,7 +786,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -897,7 +897,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] WHERE [e1].[Id] < 10 ) AS [s] ON [e0].[Id] = [s].[ThreeId] ) AS [s0] ON [r].[Id] = [s0].[RootSkipSharedId] -ORDER BY [r].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[Id], [s0].[OneId], [s0].[ThreeId] +ORDER BY [r].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[OneId] """); } @@ -931,7 +931,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] WHERE 1 < [s].[row] AND [s].[row] <= 3 ) AS [s0] ON [e0].[Key1] = [s0].[CompositeId1] AND [e0].[Key2] = [s0].[CompositeId2] AND [e0].[Key3] = [s0].[CompositeId3] ) AS [s1] ON [r].[Id] = [s1].[RootSkipSharedId] -ORDER BY [r].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2], [s1].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] +ORDER BY [r].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] """); } @@ -956,7 +956,7 @@ FROM [EntityCompositeKeyEntityTwo] AS [e0] ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] WHERE [e].[Key1] < 5 ) AS [s0] ON [r].[Id] = [s0].[LeafId] -ORDER BY [r].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [r].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -985,7 +985,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -1012,7 +1012,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] ON [e0].[Id] = [s0].[TwoId] WHERE [e0].[Id] < 10 ) AS [s1] ON [e].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[Id], [s1].[TwoId0], [s1].[Id0] +ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[TwoId0], [s1].[Id0] """); } @@ -1032,7 +1032,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1072,7 +1072,7 @@ WHERE [s].[Id] < 20 ) AS [s2] ON [e0].[Id] = [s2].[EntityOneId] WHERE [e0].[Id] < 10 ) AS [s3] ON [e].[Id] = [s3].[ThreeId] -ORDER BY [e].[Id], [s3].[OneId], [s3].[ThreeId], [s3].[Id], [s3].[OneId0], [s3].[Id0], [s3].[TwoId], [s3].[EntityBranchId], [s3].[EntityOneId] +ORDER BY [e].[Id], [s3].[OneId], [s3].[ThreeId], [s3].[OneId0], [s3].[Id0], [s3].[TwoId], [s3].[EntityBranchId] """); } @@ -1095,7 +1095,7 @@ WHERE [e1].[Id] < 5 ) AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1118,7 +1118,7 @@ WHERE [e1].[Id] < 5 ) AS [s] ON [e0].[Id] = [s].[TwoId] WHERE [e0].[Id] > 15 ) AS [s0] ON [e].[Id] = [s0].[CollectionInverseId] -ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId], [s0].[TwoId] +ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId] """); } @@ -1218,11 +1218,11 @@ FROM [Roots] AS [r] INNER JOIN [Leaves] AS [l] ON [r].[Id] = [l].[Id] ) AS [s] ON [j].[LeafId] = [s].[Id] ) AS [s0] ON [e].[Key1] = [s0].[CompositeId1] AND [e].[Key2] = [s0].[CompositeId2] AND [e].[Key3] = [s0].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3] """, // """ -SELECT [s1].[Id], [s1].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id] +SELECT [s1].[Id], [s1].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3] FROM [EntityCompositeKeys] AS [e] INNER JOIN ( SELECT [s].[Id], [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3] @@ -1239,7 +1239,7 @@ INNER JOIN ( FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e0] ON [j0].[EntityOneId] = [e0].[Id] ) AS [s1] ON [s0].[Id] = [s1].[EntityBranchId] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3] """); } @@ -1263,11 +1263,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """, // """ -SELECT [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +SELECT [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [e1].[Id] AS [Id0], [j].[OneId], [j].[ThreeId] @@ -1280,7 +1280,7 @@ INNER JOIN ( FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s0] ON [s].[Id] = [s0].[LeftId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """); } @@ -1464,11 +1464,11 @@ INNER JOIN ( FROM [EntityRootEntityThree] AS [e] INNER JOIN [EntityThrees] AS [e0] ON [e].[ThreeSkipSharedId] = [e0].[Id] ) AS [s] ON [r].[Id] = [s].[RootSkipSharedId] -ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """, // """ -SELECT [s0].[Id], [s0].[Name], [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +SELECT [s0].[Id], [s0].[Name], [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] FROM [Roots] AS [r] INNER JOIN ( SELECT [e0].[Id], [e].[RootSkipSharedId], [e].[ThreeSkipSharedId] @@ -1481,7 +1481,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e1] ON [j].[OneId] = [e1].[Id] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[ThreeId] -ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """); } @@ -1512,11 +1512,11 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityRoot] AS [e] INNER JOIN [EntityCompositeKeys] AS [e0] ON [e].[CompositeKeySkipSharedKey1] = [e0].[Key1] AND [e].[CompositeKeySkipSharedKey2] = [e0].[Key2] AND [e].[CompositeKeySkipSharedKey3] = [e0].[Key3] ) AS [s] ON [r].[Id] = [s].[RootSkipSharedId] -ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] FROM [Roots] AS [r] INNER JOIN ( SELECT [e0].[Key1], [e0].[Key2], [e0].[Key3], [e].[RootSkipSharedId], [e].[CompositeKeySkipSharedKey1], [e].[CompositeKeySkipSharedKey2], [e].[CompositeKeySkipSharedKey3] @@ -1532,7 +1532,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Key1] = [s1].[CompositeId1] AND [s].[Key2] = [s1].[CompositeId2] AND [s].[Key3] = [s1].[CompositeId3] -ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] +ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] """); } @@ -1560,11 +1560,11 @@ FROM [JoinCompositeKeyToLeaf] AS [j] INNER JOIN [EntityCompositeKeys] AS [e] ON [j].[CompositeId1] = [e].[Key1] AND [j].[CompositeId2] = [e].[Key2] AND [j].[CompositeId3] = [e].[Key3] WHERE [e].[Key1] < 5 ) AS [s] ON [r].[Id] = [s].[LeafId] -ORDER BY [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [Roots] AS [r] INNER JOIN [Branches] AS [b] ON [r].[Id] = [b].[Id] INNER JOIN [Leaves] AS [l] ON [r].[Id] = [l].[Id] @@ -1579,7 +1579,7 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e0] INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] ) AS [s0] ON [s].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [s].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [s].[Key3] = [s0].[CompositeKeySkipSharedKey3] -ORDER BY [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1610,7 +1610,7 @@ FROM [JoinOneToTwo] AS [j] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId], [s0].[Id] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [s].[Id], [s].[OneId], [s].[TwoId] @@ -1651,11 +1651,11 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityTwos] AS [e0] ON [j].[TwoId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[TwoId] @@ -1672,7 +1672,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s1].[TwoId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s1].[TwoId], [s1].[Id] """); } @@ -1697,11 +1697,11 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] FROM [EntityTwos] AS [e] INNER JOIN ( SELECT [e0].[Id], [e1].[Id] AS [Id0], [j].[OneId], [j].[TwoId] @@ -1711,7 +1711,7 @@ FROM [JoinOneToTwo] AS [j] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] INNER JOIN [EntityTwos] AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1735,11 +1735,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId] """, // """ -SELECT [s2].[Id], [s2].[CollectionInverseId], [s2].[ExtraId], [s2].[Name], [s2].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id] +SELECT [s2].[Id], [s2].[CollectionInverseId], [s2].[ExtraId], [s2].[Name], [s2].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[ThreeId] @@ -1756,11 +1756,11 @@ FROM [JoinOneToTwo] AS [j0] ) AS [s1] WHERE 1 < [s1].[row] AND [s1].[row] <= 3 ) AS [s2] ON [s0].[Id] = [s2].[OneId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s2].[OneId], [s2].[Id] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s2].[OneId], [s2].[Id] """, // """ -SELECT [s3].[Id], [s3].[Name], [s3].[Number], [s3].[IsGreen], [s3].[Discriminator], [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id] +SELECT [s3].[Id], [s3].[Name], [s3].[Number], [s3].[IsGreen], [s3].[Discriminator], [e].[Id], [s0].[OneId], [s0].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[ThreeId] @@ -1781,7 +1781,7 @@ FROM [Roots] AS [r] ) AS [s] ON [j1].[EntityBranchId] = [s].[Id] WHERE [s].[Id] < 20 ) AS [s3] ON [s0].[Id] = [s3].[EntityOneId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId] """); } @@ -1805,11 +1805,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[ThreeId] @@ -1822,7 +1822,7 @@ INNER JOIN ( FROM [EntityTwos] AS [e1] WHERE [e1].[Id] < 5 ) AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -2058,7 +2058,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -2212,7 +2212,7 @@ FROM [UnidirectionalRoots] AS [u1] ) AS [s] ON [u0].[RootSkipSharedId] = [s].[Id] WHERE [s].[Discriminator] = N'UnidirectionalEntityLeaf' ) AS [s0] ON [u].[Key1] = [s0].[UnidirectionalEntityCompositeKeyKey1] AND [u].[Key2] = [s0].[UnidirectionalEntityCompositeKeyKey2] AND [u].[Key3] = [s0].[UnidirectionalEntityCompositeKeyKey3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[RootSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2], [s0].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[RootSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2364,7 +2364,7 @@ LEFT JOIN ( FROM [UnidirectionalJoinOneSelfPayload] AS [u0] INNER JOIN [UnidirectionalEntityOnes] AS [u1] ON [u0].[LeftId] = [u1].[Id] ) AS [s] ON [u].[Id] = [s].[RightId] -ORDER BY [u].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [u].[Id], [s].[LeftId] """); } @@ -2389,7 +2389,7 @@ FROM [UnidirectionalRoots] AS [u1] LEFT JOIN [UnidirectionalLeaves] AS [u3] ON [u1].[Id] = [u3].[Id] ) AS [s] ON [u0].[RootSkipSharedId] = [s].[Id] ) AS [s0] ON [u].[Key1] = [s0].[UnidirectionalEntityCompositeKeyKey1] AND [u].[Key2] = [s0].[UnidirectionalEntityCompositeKeyKey2] AND [u].[Key3] = [s0].[UnidirectionalEntityCompositeKeyKey3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[RootSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2], [s0].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[RootSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2407,7 +2407,7 @@ FROM [UnidirectionalJoinOneToTwo] AS [u0] INNER JOIN [UnidirectionalEntityOnes] AS [u1] ON [u0].[OneId] = [u1].[Id] LEFT JOIN [UnidirectionalEntityTwos] AS [u2] ON [u1].[Id] = [u2].[ReferenceInverseId] ) AS [s] ON [u].[Id] = [s].[TwoId] -ORDER BY [u].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [u].[Id], [s].[OneId], [s].[TwoId] """); } @@ -2434,7 +2434,7 @@ FROM [UnidirectionalJoinOneToBranch] AS [u4] INNER JOIN [UnidirectionalEntityOnes] AS [u5] ON [u4].[UnidirectionalEntityOneId] = [u5].[Id] ) AS [s0] ON [s].[Id] = [s0].[UnidirectionalEntityBranchId] ) AS [s1] ON [u].[Key1] = [s1].[CompositeId1] AND [u].[Key2] = [s1].[CompositeId2] AND [u].[Key3] = [s1].[CompositeId3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s1].[LeafId], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id], [s1].[UnidirectionalEntityBranchId], [s1].[UnidirectionalEntityOneId] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s1].[LeafId], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[UnidirectionalEntityBranchId] """); } @@ -2457,7 +2457,7 @@ FROM [UnidirectionalJoinOneSelfPayload] AS [u3] INNER JOIN [UnidirectionalEntityOnes] AS [u4] ON [u3].[RightId] = [u4].[Id] ) AS [s] ON [u1].[Id] = [s].[LeftId] ) AS [s0] ON [u].[Id] = [s0].[ThreeId] -ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -2475,7 +2475,7 @@ LEFT JOIN ( FROM [UnidirectionalEntityOneUnidirectionalEntityTwo] AS [u1] INNER JOIN [UnidirectionalEntityOnes] AS [u2] ON [u1].[UnidirectionalEntityOneId] = [u2].[Id] ) AS [s] ON [u].[Id] = [s].[TwoSkipSharedId] -ORDER BY [u].[Id], [u0].[Id], [s].[TwoSkipSharedId], [s].[UnidirectionalEntityOneId] +ORDER BY [u].[Id], [u0].[Id], [s].[TwoSkipSharedId] """); } @@ -2493,7 +2493,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -2596,7 +2596,7 @@ FROM [UnidirectionalEntityCompositeKeyUnidirectionalEntityTwo] AS [u4] ) AS [s] ON [u3].[Key1] = [s].[UnidirectionalEntityCompositeKeyKey1] AND [u3].[Key2] = [s].[UnidirectionalEntityCompositeKeyKey2] AND [u3].[Key3] = [s].[UnidirectionalEntityCompositeKeyKey3] WHERE [u3].[Key1] < 5 ) AS [s0] ON [u].[Id] = [s0].[LeafId] -ORDER BY [u].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2], [s0].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2616,7 +2616,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTManyToManyQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTManyToManyQuerySqlServerTest.cs index 05ba2fb710b..25997b64f3d 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTManyToManyQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTManyToManyQuerySqlServerTest.cs @@ -378,7 +378,7 @@ FROM [Roots] AS [r] INNER JOIN [Leaves] AS [l] ON [r].[Id] = [l].[Id] ) AS [s] ON [j].[LeafId] = [s].[Id] ) AS [s0] ON [e].[Key1] = [s0].[CompositeId1] AND [e].[Key2] = [s0].[CompositeId2] AND [e].[Key3] = [s0].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2] """); } @@ -406,7 +406,7 @@ FROM [Roots] AS [r] ) AS [s] ON [e0].[RootSkipSharedId] = [s].[Id] WHERE [s].[Discriminator] = N'EntityLeaf' ) AS [s0] ON [e].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s0].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[RootSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[RootSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -605,7 +605,7 @@ LEFT JOIN ( FROM [JoinOneSelfPayload] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[LeftId] = [e0].[Id] ) AS [s] ON [e].[Id] = [s].[RightId] -ORDER BY [e].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [e].[Id], [s].[LeftId] """); } @@ -632,7 +632,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e3] INNER JOIN [EntityCompositeKeys] AS [e4] ON [e3].[CompositeKeySkipSharedKey1] = [e4].[Key1] AND [e3].[CompositeKeySkipSharedKey2] = [e4].[Key2] AND [e3].[CompositeKeySkipSharedKey3] = [e4].[Key3] ) AS [s1] ON [e].[Id] = [s1].[TwoSkipSharedId] -ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s].[Id], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s0].[Id], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2] +ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2] """); } @@ -681,7 +681,7 @@ FROM [Roots] AS [r] LEFT JOIN [Leaf2s] AS [l0] ON [r].[Id] = [l0].[Id] ) AS [s] ON [e0].[RootSkipSharedId] = [s].[Id] ) AS [s0] ON [e].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s0].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[RootSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[RootSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -699,7 +699,7 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """); } @@ -726,7 +726,7 @@ FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e0] ON [j0].[EntityOneId] = [e0].[Id] ) AS [s0] ON [s].[Id] = [s0].[EntityBranchId] ) AS [s1] ON [e].[Key1] = [s1].[CompositeId1] AND [e].[Key2] = [s1].[CompositeId2] AND [e].[Key3] = [s1].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s1].[LeafId], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id], [s1].[EntityBranchId], [s1].[EntityOneId] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s1].[LeafId], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[EntityBranchId] """); } @@ -749,7 +749,7 @@ FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s] ON [e0].[Id] = [s].[LeftId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -767,7 +767,7 @@ LEFT JOIN ( FROM [EntityOneEntityTwo] AS [e1] INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] ) AS [s] ON [e].[Id] = [s].[TwoSkipSharedId] -ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId] """); } @@ -785,7 +785,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -896,7 +896,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] WHERE [e1].[Id] < 10 ) AS [s] ON [e0].[Id] = [s].[ThreeId] ) AS [s0] ON [r].[Id] = [s0].[RootSkipSharedId] -ORDER BY [r].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[Id], [s0].[OneId], [s0].[ThreeId] +ORDER BY [r].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[OneId] """); } @@ -930,7 +930,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] WHERE 1 < [s].[row] AND [s].[row] <= 3 ) AS [s0] ON [e0].[Key1] = [s0].[CompositeId1] AND [e0].[Key2] = [s0].[CompositeId2] AND [e0].[Key3] = [s0].[CompositeId3] ) AS [s1] ON [r].[Id] = [s1].[RootSkipSharedId] -ORDER BY [r].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2], [s1].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] +ORDER BY [r].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] """); } @@ -955,7 +955,7 @@ FROM [EntityCompositeKeyEntityTwo] AS [e0] ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] WHERE [e].[Key1] < 5 ) AS [s0] ON [r].[Id] = [s0].[LeafId] -ORDER BY [r].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [r].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -984,7 +984,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -1011,7 +1011,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] ON [e0].[Id] = [s0].[TwoId] WHERE [e0].[Id] < 10 ) AS [s1] ON [e].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[Id], [s1].[TwoId0], [s1].[Id0] +ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[TwoId0], [s1].[Id0] """); } @@ -1031,7 +1031,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1071,7 +1071,7 @@ WHERE [s].[Id] < 20 ) AS [s2] ON [e0].[Id] = [s2].[EntityOneId] WHERE [e0].[Id] < 10 ) AS [s3] ON [e].[Id] = [s3].[ThreeId] -ORDER BY [e].[Id], [s3].[OneId], [s3].[ThreeId], [s3].[Id], [s3].[OneId0], [s3].[Id0], [s3].[TwoId], [s3].[EntityBranchId], [s3].[EntityOneId] +ORDER BY [e].[Id], [s3].[OneId], [s3].[ThreeId], [s3].[OneId0], [s3].[Id0], [s3].[TwoId], [s3].[EntityBranchId] """); } @@ -1094,7 +1094,7 @@ WHERE [e1].[Id] < 5 ) AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1117,7 +1117,7 @@ WHERE [e1].[Id] < 5 ) AS [s] ON [e0].[Id] = [s].[TwoId] WHERE [e0].[Id] > 15 ) AS [s0] ON [e].[Id] = [s0].[CollectionInverseId] -ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId], [s0].[TwoId] +ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId] """); } @@ -1217,11 +1217,11 @@ FROM [Roots] AS [r] INNER JOIN [Leaves] AS [l] ON [r].[Id] = [l].[Id] ) AS [s] ON [j].[LeafId] = [s].[Id] ) AS [s0] ON [e].[Key1] = [s0].[CompositeId1] AND [e].[Key2] = [s0].[CompositeId2] AND [e].[Key3] = [s0].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3] """, // """ -SELECT [s1].[EntityBranchId], [s1].[EntityOneId], [s1].[Id], [s1].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id] +SELECT [s1].[EntityBranchId], [s1].[EntityOneId], [s1].[Id], [s1].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3] FROM [EntityCompositeKeys] AS [e] INNER JOIN ( SELECT [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [s].[Id] @@ -1238,7 +1238,7 @@ INNER JOIN ( FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e0] ON [j0].[EntityOneId] = [e0].[Id] ) AS [s1] ON [s0].[Id] = [s1].[EntityBranchId] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3] """); } @@ -1262,11 +1262,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """, // """ -SELECT [s0].[LeftId], [s0].[RightId], [s0].[Payload], [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +SELECT [s0].[LeftId], [s0].[RightId], [s0].[Payload], [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id], [e1].[Id] AS [Id0] @@ -1279,7 +1279,7 @@ INNER JOIN ( FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s0] ON [s].[Id] = [s0].[LeftId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """); } @@ -1463,11 +1463,11 @@ INNER JOIN ( FROM [EntityRootEntityThree] AS [e] INNER JOIN [EntityThrees] AS [e0] ON [e].[ThreeSkipSharedId] = [e0].[Id] ) AS [s] ON [r].[Id] = [s].[RootSkipSharedId] -ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """, // """ -SELECT [s0].[OneId], [s0].[ThreeId], [s0].[Payload], [s0].[Id], [s0].[Name], [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +SELECT [s0].[OneId], [s0].[ThreeId], [s0].[Payload], [s0].[Id], [s0].[Name], [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] FROM [Roots] AS [r] INNER JOIN ( SELECT [e].[RootSkipSharedId], [e].[ThreeSkipSharedId], [e0].[Id] @@ -1480,7 +1480,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e1] ON [j].[OneId] = [e1].[Id] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[ThreeId] -ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """); } @@ -1511,11 +1511,11 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityRoot] AS [e] INNER JOIN [EntityCompositeKeys] AS [e0] ON [e].[CompositeKeySkipSharedKey1] = [e0].[Key1] AND [e].[CompositeKeySkipSharedKey2] = [e0].[Key2] AND [e].[CompositeKeySkipSharedKey3] = [e0].[Key3] ) AS [s] ON [r].[Id] = [s].[RootSkipSharedId] -ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] """, // """ -SELECT [s1].[Id], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[ThreeId], [s1].[Id0], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s1].[Id], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[ThreeId], [s1].[Id0], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] FROM [Roots] AS [r] INNER JOIN ( SELECT [e].[RootSkipSharedId], [e].[CompositeKeySkipSharedKey1], [e].[CompositeKeySkipSharedKey2], [e].[CompositeKeySkipSharedKey3], [e0].[Key1], [e0].[Key2], [e0].[Key3] @@ -1531,7 +1531,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Key1] = [s1].[CompositeId1] AND [s].[Key2] = [s1].[CompositeId2] AND [s].[Key3] = [s1].[CompositeId3] -ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] +ORDER BY [r].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] """); } @@ -1559,11 +1559,11 @@ FROM [JoinCompositeKeyToLeaf] AS [j] INNER JOIN [EntityCompositeKeys] AS [e] ON [j].[CompositeId1] = [e].[Key1] AND [j].[CompositeId2] = [e].[Key2] AND [j].[CompositeId3] = [e].[Key3] WHERE [e].[Key1] < 5 ) AS [s] ON [r].[Id] = [s].[LeafId] -ORDER BY [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3], [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3], [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [Roots] AS [r] INNER JOIN [Branches] AS [b] ON [r].[Id] = [b].[Id] INNER JOIN [Leaves] AS [l] ON [r].[Id] = [l].[Id] @@ -1578,7 +1578,7 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e0] INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] ) AS [s0] ON [s].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [s].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [s].[Key3] = [s0].[CompositeKeySkipSharedKey3] -ORDER BY [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [r].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1609,7 +1609,7 @@ FROM [JoinOneToTwo] AS [j] """, // """ -SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId], [s0].[Id] +SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [s].[OneId], [s].[TwoId], [s].[Id] @@ -1650,11 +1650,11 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityTwos] AS [e0] ON [j].[TwoId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """, // """ -SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[TwoId], [e0].[Id] @@ -1671,7 +1671,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s1].[TwoId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s1].[TwoId], [s1].[Id] """); } @@ -1696,11 +1696,11 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] FROM [EntityTwos] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[TwoId], [e0].[Id], [e1].[Id] AS [Id0] @@ -1710,7 +1710,7 @@ FROM [JoinOneToTwo] AS [j] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] INNER JOIN [EntityTwos] AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1734,11 +1734,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId] """, // """ -SELECT [s2].[OneId], [s2].[TwoId], [s2].[JoinOneToTwoExtraId], [s2].[Id], [s2].[CollectionInverseId], [s2].[ExtraId], [s2].[Name], [s2].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id] +SELECT [s2].[OneId], [s2].[TwoId], [s2].[JoinOneToTwoExtraId], [s2].[Id], [s2].[CollectionInverseId], [s2].[ExtraId], [s2].[Name], [s2].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id] @@ -1755,11 +1755,11 @@ FROM [JoinOneToTwo] AS [j0] ) AS [s1] WHERE 1 < [s1].[row] AND [s1].[row] <= 3 ) AS [s2] ON [s0].[Id] = [s2].[OneId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s2].[OneId], [s2].[Id] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s2].[OneId], [s2].[Id] """, // """ -SELECT [s3].[EntityBranchId], [s3].[EntityOneId], [s3].[Id], [s3].[Name], [s3].[Number], [s3].[IsGreen], [s3].[Discriminator], [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id] +SELECT [s3].[EntityBranchId], [s3].[EntityOneId], [s3].[Id], [s3].[Name], [s3].[Number], [s3].[IsGreen], [s3].[Discriminator], [e].[Id], [s0].[OneId], [s0].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id] @@ -1780,7 +1780,7 @@ FROM [Roots] AS [r] ) AS [s] ON [j1].[EntityBranchId] = [s].[Id] WHERE [s].[Id] < 20 ) AS [s3] ON [s0].[Id] = [s3].[EntityOneId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId] """); } @@ -1804,11 +1804,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id] @@ -1821,7 +1821,7 @@ INNER JOIN ( FROM [EntityTwos] AS [e1] WHERE [e1].[Id] < 5 ) AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1883,7 +1883,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j0] INNER JOIN [EntityThrees] AS [e1] ON [j0].[ThreeId] = [e1].[Id] ) AS [s] ON [e0].[Id] = [s].[OneId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[OneId0], [s0].[ThreeId0] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[OneId0] """); } @@ -2065,7 +2065,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -2212,7 +2212,7 @@ FROM [UnidirectionalRoots] AS [u1] ) AS [s] ON [u0].[RootSkipSharedId] = [s].[Id] WHERE [s].[Discriminator] = N'UnidirectionalEntityLeaf' ) AS [s0] ON [u].[Key1] = [s0].[UnidirectionalEntityCompositeKeyKey1] AND [u].[Key2] = [s0].[UnidirectionalEntityCompositeKeyKey2] AND [u].[Key3] = [s0].[UnidirectionalEntityCompositeKeyKey3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[RootSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2], [s0].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[RootSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2364,7 +2364,7 @@ LEFT JOIN ( FROM [UnidirectionalJoinOneSelfPayload] AS [u0] INNER JOIN [UnidirectionalEntityOnes] AS [u1] ON [u0].[LeftId] = [u1].[Id] ) AS [s] ON [u].[Id] = [s].[RightId] -ORDER BY [u].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [u].[Id], [s].[LeftId] """); } @@ -2389,7 +2389,7 @@ FROM [UnidirectionalRoots] AS [u1] LEFT JOIN [UnidirectionalLeaves] AS [u3] ON [u1].[Id] = [u3].[Id] ) AS [s] ON [u0].[RootSkipSharedId] = [s].[Id] ) AS [s0] ON [u].[Key1] = [s0].[UnidirectionalEntityCompositeKeyKey1] AND [u].[Key2] = [s0].[UnidirectionalEntityCompositeKeyKey2] AND [u].[Key3] = [s0].[UnidirectionalEntityCompositeKeyKey3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[RootSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2], [s0].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s0].[RootSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2407,7 +2407,7 @@ FROM [UnidirectionalJoinOneToTwo] AS [u0] INNER JOIN [UnidirectionalEntityOnes] AS [u1] ON [u0].[OneId] = [u1].[Id] LEFT JOIN [UnidirectionalEntityTwos] AS [u2] ON [u1].[Id] = [u2].[ReferenceInverseId] ) AS [s] ON [u].[Id] = [s].[TwoId] -ORDER BY [u].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [u].[Id], [s].[OneId], [s].[TwoId] """); } @@ -2434,7 +2434,7 @@ FROM [UnidirectionalJoinOneToBranch] AS [u4] INNER JOIN [UnidirectionalEntityOnes] AS [u5] ON [u4].[UnidirectionalEntityOneId] = [u5].[Id] ) AS [s0] ON [s].[Id] = [s0].[UnidirectionalEntityBranchId] ) AS [s1] ON [u].[Key1] = [s1].[CompositeId1] AND [u].[Key2] = [s1].[CompositeId2] AND [u].[Key3] = [s1].[CompositeId3] -ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s1].[LeafId], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id], [s1].[UnidirectionalEntityBranchId], [s1].[UnidirectionalEntityOneId] +ORDER BY [u].[Key1], [u].[Key2], [u].[Key3], [s1].[LeafId], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[UnidirectionalEntityBranchId] """); } @@ -2457,7 +2457,7 @@ FROM [UnidirectionalJoinOneSelfPayload] AS [u3] INNER JOIN [UnidirectionalEntityOnes] AS [u4] ON [u3].[RightId] = [u4].[Id] ) AS [s] ON [u1].[Id] = [s].[LeftId] ) AS [s0] ON [u].[Id] = [s0].[ThreeId] -ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -2475,7 +2475,7 @@ LEFT JOIN ( FROM [UnidirectionalEntityOneUnidirectionalEntityTwo] AS [u1] INNER JOIN [UnidirectionalEntityOnes] AS [u2] ON [u1].[UnidirectionalEntityOneId] = [u2].[Id] ) AS [s] ON [u].[Id] = [s].[TwoSkipSharedId] -ORDER BY [u].[Id], [u0].[Id], [s].[TwoSkipSharedId], [s].[UnidirectionalEntityOneId] +ORDER BY [u].[Id], [u0].[Id], [s].[TwoSkipSharedId] """); } @@ -2497,7 +2497,7 @@ FROM [UnidirectionalJoinOneToThreePayloadFullShared] AS [u2] INNER JOIN [UnidirectionalEntityThrees] AS [u3] ON [u2].[ThreeId] = [u3].[Id] ) AS [s] ON [u1].[Id] = [s].[OneId] ) AS [s0] ON [u].[Id] = [s0].[ThreeId] -ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[OneId0], [s0].[ThreeId0] +ORDER BY [u].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[OneId0] """); } @@ -2515,7 +2515,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -2620,7 +2620,7 @@ FROM [UnidirectionalEntityCompositeKeyUnidirectionalEntityTwo] AS [u4] ) AS [s] ON [u3].[Key1] = [s].[UnidirectionalEntityCompositeKeyKey1] AND [u3].[Key2] = [s].[UnidirectionalEntityCompositeKeyKey2] AND [u3].[Key3] = [s].[UnidirectionalEntityCompositeKeyKey3] WHERE [u3].[Key1] < 5 ) AS [s0] ON [u].[Id] = [s0].[LeafId] -ORDER BY [u].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2], [s0].[UnidirectionalEntityCompositeKeyKey3] +ORDER BY [u].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[UnidirectionalEntityCompositeKeyKey1], [s0].[UnidirectionalEntityCompositeKeyKey2] """); } @@ -2640,7 +2640,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTRelationshipsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTRelationshipsQuerySqlServerTest.cs index b59bc0d2945..d83e91a0d17 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTRelationshipsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTRelationshipsQuerySqlServerTest.cs @@ -81,7 +81,7 @@ FROM [BaseEntities] AS [b] ) AS [s] ON [c].[ParentId] = [s].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [s].[Id] = [b0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d0] ON [s].[Id] = [d0].[DerivedInheritanceRelationshipEntityId] -ORDER BY [c].[Id], [s].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] +ORDER BY [c].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] """); } @@ -122,7 +122,7 @@ FROM [BaseEntities] AS [b] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [s].[Id] = [b0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d0] ON [s].[Id] = [d0].[DerivedInheritanceRelationshipEntityId] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [s].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] +ORDER BY [c].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] """); } @@ -232,7 +232,7 @@ FROM [BaseEntities] AS [b0] ) AS [s] ON [b].[ParentId] = [s].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [s].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -256,7 +256,7 @@ FROM [BaseEntities] AS [b0] ) AS [s] ON [b].[BaseParentId] = [s].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [s].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -306,7 +306,7 @@ FROM [BaseEntities] AS [b0] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [s].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -375,7 +375,7 @@ FROM [BaseEntities] AS [b] ) AS [s] ON [r].[ParentId] = [s].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [s].[Id] = [b0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d0] ON [s].[Id] = [d0].[DerivedInheritanceRelationshipEntityId] -ORDER BY [r].[Id], [s].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] +ORDER BY [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] """); } @@ -396,7 +396,7 @@ FROM [BaseEntities] AS [b] ) AS [s] ON [r].[ParentId] = [s].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [s].[Id] = [b0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d0] ON [s].[Id] = [d0].[DerivedInheritanceRelationshipEntityId] -ORDER BY [r].[Id], [s].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] +ORDER BY [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] """); } @@ -437,7 +437,7 @@ FROM [BaseEntities] AS [b] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [s].[Id] = [b0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d0] ON [s].[Id] = [d0].[DerivedInheritanceRelationshipEntityId] WHERE [r].[Name] <> N'Bar' OR [r].[Name] IS NULL -ORDER BY [r].[Id], [s].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] +ORDER BY [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [d0].[DerivedInheritanceRelationshipEntityId] """); } @@ -547,7 +547,7 @@ FROM [BaseEntities] AS [b0] ) AS [s] ON [b].[BaseParentId] = [s].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [s].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -637,7 +637,7 @@ FROM [BaseEntities] AS [b0] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [s].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -661,7 +661,7 @@ FROM [BaseEntities] AS [b0] ) AS [s] ON [b].[BaseParentId] = [s].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [s].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -711,7 +711,7 @@ FROM [BaseEntities] AS [b0] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [s].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -745,7 +745,7 @@ public override async Task Include_self_reference_with_inheritance_reverse(bool AssertSql( """ -SELECT [b].[Id], [b].[Name], [d].[BaseId], [s].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [s].[Name], [s].[BaseId], [s].[Discriminator], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [s].[OwnedReferenceOnBase_Id], [s].[OwnedReferenceOnBase_Name], [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [s].[Id0], [s].[OwnedReferenceOnDerived_Id], [s].[OwnedReferenceOnDerived_Name] +SELECT [b].[Id], [b].[Name], [d].[BaseId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name], [d].[Id], [d].[OwnedReferenceOnDerived_Id], [d].[OwnedReferenceOnDerived_Name], [s].[Id], [s].[Name], [s].[BaseId], [s].[Discriminator], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [s].[OwnedReferenceOnBase_Id], [s].[OwnedReferenceOnBase_Name], [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [s].[Id0], [s].[OwnedReferenceOnDerived_Id], [s].[OwnedReferenceOnDerived_Name] FROM [BaseEntities] AS [b] INNER JOIN [DerivedEntities] AS [d] ON [b].[Id] = [d].[Id] LEFT JOIN ( @@ -759,7 +759,7 @@ FROM [BaseEntities] AS [b0] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [b].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [s].[Id] = [b2].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [s].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [s].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [d2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [d2].[DerivedInheritanceRelationshipEntityId] """); } @@ -776,7 +776,7 @@ LEFT JOIN ( FROM [PrincipalEntities] AS [p] LEFT JOIN [ReferencedEntities] AS [r0] ON [p].[ReferenceId] = [r0].[Id] ) AS [s] ON [r].[Id] = [s].[ReferencedEntityId] -ORDER BY [r].[Id], [s].[Id] +ORDER BY [r].[Id] """); } @@ -838,7 +838,7 @@ FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s0].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -900,7 +900,7 @@ FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s0].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -991,7 +991,7 @@ FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s0].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -1082,7 +1082,7 @@ FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s0].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [d1].[DerivedInheritanceRelationshipEntityId] """); } @@ -1188,29 +1188,29 @@ WHEN [d0].[Id] IS NOT NULL THEN N'DerivedInheritanceRelationshipEntity' FROM [BaseEntities] AS [b0] LEFT JOIN [DerivedEntities] AS [d0] ON [b0].[Id] = [d0].[Id] ) AS [s] ON [b].[BaseParentId] = [s].[Id] -ORDER BY [b].[Id], [s].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b].[Id], [s].[Id] +SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b].[Id] FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN ( SELECT [b0].[Id] FROM [BaseEntities] AS [b0] ) AS [s] ON [b].[BaseParentId] = [s].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [s].[Id] = [b2].[BaseInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [s].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [b].[Id], [s].[Id] +SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [b].[Id] FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN ( SELECT [b0].[Id] FROM [BaseEntities] AS [b0] ) AS [s] ON [b].[BaseParentId] = [s].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [s].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [s].[Id] +ORDER BY [b].[Id] """); } @@ -1279,11 +1279,11 @@ FROM [BaseEntities] AS [b0] LEFT JOIN [DerivedEntities] AS [d0] ON [b0].[Id] = [d0].[Id] ) AS [s] ON [b].[BaseParentId] = [s].[Id] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [s].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b].[Id], [s].[Id] +SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b].[Id] FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN ( SELECT [b0].[Id] @@ -1291,11 +1291,11 @@ FROM [BaseEntities] AS [b0] ) AS [s] ON [b].[BaseParentId] = [s].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [s].[Id] = [b2].[BaseInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [s].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [b].[Id], [s].[Id] +SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [b].[Id] FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN ( SELECT [b0].[Id] @@ -1303,7 +1303,7 @@ FROM [BaseEntities] AS [b0] ) AS [s] ON [b].[BaseParentId] = [s].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [s].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [s].[Id] +ORDER BY [b].[Id] """); } @@ -1358,29 +1358,29 @@ WHEN [d].[Id] IS NOT NULL THEN N'DerivedInheritanceRelationshipEntity' FROM [BaseEntities] AS [b] LEFT JOIN [DerivedEntities] AS [d] ON [b].[Id] = [d].[Id] ) AS [s] ON [c].[ParentId] = [s].[Id] -ORDER BY [c].[Id], [s].[Id] +ORDER BY [c].[Id] """, // """ -SELECT [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [c].[Id], [s].[Id] +SELECT [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [c].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN ( SELECT [b].[Id] FROM [BaseEntities] AS [b] ) AS [s] ON [c].[ParentId] = [s].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s].[Id] = [b1].[BaseInheritanceRelationshipEntityId] -ORDER BY [c].[Id], [s].[Id] +ORDER BY [c].[Id] """, // """ -SELECT [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name], [c].[Id], [s].[Id] +SELECT [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name], [c].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN ( SELECT [b].[Id] FROM [BaseEntities] AS [b] ) AS [s] ON [c].[ParentId] = [s].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [c].[Id], [s].[Id] +ORDER BY [c].[Id] """); } @@ -1440,11 +1440,11 @@ FROM [BaseEntities] AS [b] LEFT JOIN [DerivedEntities] AS [d] ON [b].[Id] = [d].[Id] ) AS [s] ON [c].[ParentId] = [s].[Id] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [s].[Id] +ORDER BY [c].[Id] """, // """ -SELECT [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [c].[Id], [s].[Id] +SELECT [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [c].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN ( SELECT [b].[Id] @@ -1452,11 +1452,11 @@ FROM [BaseEntities] AS [b] ) AS [s] ON [c].[ParentId] = [s].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [s].[Id] = [b1].[BaseInheritanceRelationshipEntityId] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [s].[Id] +ORDER BY [c].[Id] """, // """ -SELECT [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name], [c].[Id], [s].[Id] +SELECT [d1].[DerivedInheritanceRelationshipEntityId], [d1].[Id], [d1].[Name], [c].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN ( SELECT [b].[Id] @@ -1464,7 +1464,7 @@ FROM [BaseEntities] AS [b] ) AS [s] ON [c].[ParentId] = [s].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d1] ON [s].[Id] = [d1].[DerivedInheritanceRelationshipEntityId] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [s].[Id] +ORDER BY [c].[Id] """); } @@ -1611,11 +1611,11 @@ LEFT JOIN ( FROM [BaseEntities] AS [b0] INNER JOIN [DerivedEntities] AS [d0] ON [b0].[Id] = [d0].[Id] ) AS [s] ON [b].[ParentId] = [s].[Id] -ORDER BY [b].[Id], [s].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b].[Id], [s].[Id] +SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b].[Id] FROM [BaseCollectionsOnDerived] AS [b] LEFT JOIN ( SELECT [b0].[Id] @@ -1623,11 +1623,11 @@ FROM [BaseEntities] AS [b0] INNER JOIN [DerivedEntities] AS [d0] ON [b0].[Id] = [d0].[Id] ) AS [s] ON [b].[ParentId] = [s].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [s].[Id] = [b2].[BaseInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [s].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [b].[Id], [s].[Id] +SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [b].[Id] FROM [BaseCollectionsOnDerived] AS [b] LEFT JOIN ( SELECT [b0].[Id] @@ -1635,7 +1635,7 @@ FROM [BaseEntities] AS [b0] INNER JOIN [DerivedEntities] AS [d0] ON [b0].[Id] = [d0].[Id] ) AS [s] ON [b].[ParentId] = [s].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [s].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [s].[Id] +ORDER BY [b].[Id] """); } @@ -1787,11 +1787,11 @@ WHEN [d0].[Id] IS NOT NULL THEN N'DerivedInheritanceRelationshipEntity' FROM [BaseEntities] AS [b0] LEFT JOIN [DerivedEntities] AS [d0] ON [b0].[Id] = [d0].[Id] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] -ORDER BY [n].[Id], [s].[Id], [s0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id], [s].[Id], [s0].[Id] +SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id] FROM [NestedCollections] AS [n] LEFT JOIN ( SELECT [b].[Id], [b].[BaseParentId] @@ -1802,11 +1802,11 @@ SELECT [b0].[Id] FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [s0].[Id] = [b2].[BaseInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [n].[Id], [s].[Id], [s0].[Id] +SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [n].[Id] FROM [NestedCollections] AS [n] LEFT JOIN ( SELECT [b].[Id], [b].[BaseParentId] @@ -1817,7 +1817,7 @@ SELECT [b0].[Id] FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [s0].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id] +ORDER BY [n].[Id] """); } @@ -1895,11 +1895,11 @@ WHEN [d0].[Id] IS NOT NULL THEN N'DerivedInheritanceRelationshipEntity' FROM [BaseEntities] AS [b0] LEFT JOIN [DerivedEntities] AS [d0] ON [b0].[Id] = [d0].[Id] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] -ORDER BY [n].[Id], [s].[Id], [s0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id], [s].[Id], [s0].[Id] +SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id] FROM [NestedReferences] AS [n] LEFT JOIN ( SELECT [b].[Id], [b].[BaseParentId] @@ -1910,11 +1910,11 @@ SELECT [b0].[Id] FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [s0].[Id] = [b2].[BaseInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [n].[Id], [s].[Id], [s0].[Id] +SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [n].[Id] FROM [NestedReferences] AS [n] LEFT JOIN ( SELECT [b].[Id], [b].[BaseParentId] @@ -1925,7 +1925,7 @@ SELECT [b0].[Id] FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [s0].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id] +ORDER BY [n].[Id] """); } @@ -2013,11 +2013,11 @@ WHEN [d0].[Id] IS NOT NULL THEN N'DerivedInheritanceRelationshipEntity' FROM [BaseEntities] AS [b0] LEFT JOIN [DerivedEntities] AS [d0] ON [b0].[Id] = [d0].[Id] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] -ORDER BY [n].[Id], [s].[Id], [s0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id], [s].[Id], [s0].[Id] +SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [n].[Id] FROM [NestedCollections] AS [n] LEFT JOIN ( SELECT [b].[Id], [b].[BaseParentId] @@ -2028,11 +2028,11 @@ SELECT [b0].[Id] FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [s0].[Id] = [b2].[BaseInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [n].[Id], [s].[Id], [s0].[Id] +SELECT [d2].[DerivedInheritanceRelationshipEntityId], [d2].[Id], [d2].[Name], [n].[Id] FROM [NestedCollections] AS [n] LEFT JOIN ( SELECT [b].[Id], [b].[BaseParentId] @@ -2043,7 +2043,7 @@ SELECT [b0].[Id] FROM [BaseEntities] AS [b0] ) AS [s0] ON [s].[BaseParentId] = [s0].[Id] INNER JOIN [DerivedEntities_OwnedCollectionOnDerived] AS [d2] ON [s0].[Id] = [d2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [s].[Id], [s0].[Id] +ORDER BY [n].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/InheritanceRelationshipsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/InheritanceRelationshipsQuerySqlServerTest.cs index a59684c3a3d..ea71870b5ea 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/InheritanceRelationshipsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/InheritanceRelationshipsQuerySqlServerTest.cs @@ -45,7 +45,7 @@ FROM [BaseReferencesOnBase] AS [b] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b2] ON [b0].[Id] = [b2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] """); } @@ -76,7 +76,7 @@ public override async Task Include_self_reference_with_inheritance_reverse(bool AssertSql( """ -SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name] +SELECT [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b1].[Name], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name] FROM [BaseEntities] AS [b] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseId] = [b0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b].[Id] = [b1].[BaseInheritanceRelationshipEntityId] @@ -84,7 +84,7 @@ FROM [BaseEntities] AS [b] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b3] ON [b0].[Id] = [b3].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b4] ON [b0].[Id] = [b4].[DerivedInheritanceRelationshipEntityId] WHERE [b].[Discriminator] = N'DerivedInheritanceRelationshipEntity' -ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b4].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId], [b2].[Id], [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b4].[DerivedInheritanceRelationshipEntityId] """); } @@ -116,7 +116,7 @@ FROM [BaseReferencesOnBase] AS [b] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b2] ON [b0].[Id] = [b2].[DerivedInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] """); } @@ -146,7 +146,7 @@ FROM [ReferencesOnBase] AS [r] LEFT JOIN [BaseEntities] AS [b] ON [r].[ParentId] = [b].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [b].[Id] = [b0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b1] ON [b].[Id] = [b1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [r].[Id], [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId] """); } @@ -178,7 +178,7 @@ FROM [ReferencesOnBase] AS [r] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [b].[Id] = [b0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b1] ON [b].[Id] = [b1].[DerivedInheritanceRelationshipEntityId] WHERE [r].[Name] <> N'Bar' OR [r].[Name] IS NULL -ORDER BY [r].[Id], [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [r].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId] """); } @@ -208,7 +208,7 @@ FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b2] ON [b0].[Id] = [b2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] """); } @@ -240,7 +240,7 @@ FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b2] ON [b0].[Id] = [b2].[DerivedInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] """); } @@ -270,7 +270,7 @@ FROM [CollectionsOnBase] AS [c] LEFT JOIN [BaseEntities] AS [b] ON [c].[ParentId] = [b].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [b].[Id] = [b0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b1] ON [b].[Id] = [b1].[DerivedInheritanceRelationshipEntityId] -ORDER BY [c].[Id], [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [c].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId] """); } @@ -302,7 +302,7 @@ FROM [CollectionsOnBase] AS [c] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [b].[Id] = [b0].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b1] ON [b].[Id] = [b1].[DerivedInheritanceRelationshipEntityId] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [b].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId] +ORDER BY [c].[Id], [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b1].[DerivedInheritanceRelationshipEntityId] """); } @@ -373,7 +373,7 @@ FROM [BaseEntities] AS [b0] ) AS [b1] ON [b].[BaseParentId] = [b1].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [b1].[Id] = [b2].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b3] ON [b1].[Id] = [b3].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [b1].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b3].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b3].[DerivedInheritanceRelationshipEntityId] """); } @@ -445,7 +445,7 @@ FROM [BaseEntities] AS [b0] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [b1].[Id] = [b2].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b3] ON [b1].[Id] = [b3].[DerivedInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [b1].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b3].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b3].[DerivedInheritanceRelationshipEntityId] """); } @@ -496,7 +496,7 @@ FROM [BaseEntities] AS [b] ) AS [b0] ON [r].[ParentId] = [b0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b2] ON [b0].[Id] = [b2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [r].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [r].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] """); } @@ -567,7 +567,7 @@ FROM [BaseEntities] AS [b0] ) AS [b1] ON [b].[ParentId] = [b1].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [b1].[Id] = [b2].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b3] ON [b1].[Id] = [b3].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [b1].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b3].[DerivedInheritanceRelationshipEntityId] +ORDER BY [b].[Id], [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b3].[DerivedInheritanceRelationshipEntityId] """); } @@ -616,7 +616,7 @@ FROM [NestedReferences] AS [n] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b2] ON [b0].[Id] = [b2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] """); } @@ -665,7 +665,7 @@ FROM [NestedCollections] AS [n] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b2] ON [b0].[Id] = [b2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] """); } @@ -700,7 +700,7 @@ FROM [NestedReferences] AS [n] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b2] ON [b0].[Id] = [b2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] """); } @@ -735,7 +735,7 @@ FROM [NestedCollections] AS [n] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] LEFT JOIN [BaseEntities_OwnedCollectionOnBase] AS [b1] ON [b0].[Id] = [b1].[BaseInheritanceRelationshipEntityId] LEFT JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b2] ON [b0].[Id] = [b2].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] +ORDER BY [n].[Id], [b1].[BaseInheritanceRelationshipEntityId], [b1].[Id], [b2].[DerivedInheritanceRelationshipEntityId] """); } @@ -752,7 +752,7 @@ LEFT JOIN ( FROM [PrincipalEntities] AS [p] LEFT JOIN [ReferencedEntities] AS [r0] ON [p].[ReferenceId] = [r0].[Id] ) AS [s] ON [r].[Id] = [s].[ReferencedEntityId] -ORDER BY [r].[Id], [s].[Id] +ORDER BY [r].[Id] """); } @@ -831,23 +831,23 @@ public override async Task Include_collection_with_inheritance_reverse_split(boo SELECT [b].[Id], [b].[BaseParentId], [b].[Discriminator], [b].[Name], [b].[DerivedProperty], [b0].[Id], [b0].[Discriminator], [b0].[Name], [b0].[BaseId], [b0].[OwnedReferenceOnBase_Id], [b0].[OwnedReferenceOnBase_Name], [b0].[OwnedReferenceOnDerived_Id], [b0].[OwnedReferenceOnDerived_Name] FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] -ORDER BY [b].[Id], [b0].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [b].[Id], [b0].[Id] +SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [b].[Id] FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b3] ON [b0].[Id] = [b3].[BaseInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [b0].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [b].[Id], [b0].[Id] +SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [b].[Id] FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b4] ON [b0].[Id] = [b4].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [b0].[Id] +ORDER BY [b].[Id] """); } @@ -898,25 +898,25 @@ public override async Task Include_collection_with_inheritance_with_filter_rever FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [b0].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [b].[Id], [b0].[Id] +SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [b].[Id] FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b3] ON [b0].[Id] = [b3].[BaseInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [b0].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [b].[Id], [b0].[Id] +SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [b].[Id] FROM [BaseCollectionsOnBase] AS [b] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b4] ON [b0].[Id] = [b4].[DerivedInheritanceRelationshipEntityId] WHERE [b].[Name] <> N'Bar' OR [b].[Name] IS NULL -ORDER BY [b].[Id], [b0].[Id] +ORDER BY [b].[Id] """); } @@ -962,23 +962,23 @@ public override async Task Include_collection_without_inheritance_reverse_split( SELECT [c].[Id], [c].[Name], [c].[ParentId], [b].[Id], [b].[Discriminator], [b].[Name], [b].[BaseId], [b].[OwnedReferenceOnBase_Id], [b].[OwnedReferenceOnBase_Name], [b].[OwnedReferenceOnDerived_Id], [b].[OwnedReferenceOnDerived_Name] FROM [CollectionsOnBase] AS [c] LEFT JOIN [BaseEntities] AS [b] ON [c].[ParentId] = [b].[Id] -ORDER BY [c].[Id], [b].[Id] +ORDER BY [c].[Id] """, // """ -SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [c].[Id], [b].[Id] +SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [c].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN [BaseEntities] AS [b] ON [c].[ParentId] = [b].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [b].[Id] = [b2].[BaseInheritanceRelationshipEntityId] -ORDER BY [c].[Id], [b].[Id] +ORDER BY [c].[Id] """, // """ -SELECT [b3].[DerivedInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [c].[Id], [b].[Id] +SELECT [b3].[DerivedInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [c].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN [BaseEntities] AS [b] ON [c].[ParentId] = [b].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b3] ON [b].[Id] = [b3].[DerivedInheritanceRelationshipEntityId] -ORDER BY [c].[Id], [b].[Id] +ORDER BY [c].[Id] """); } @@ -1029,25 +1029,25 @@ public override async Task Include_collection_without_inheritance_with_filter_re FROM [CollectionsOnBase] AS [c] LEFT JOIN [BaseEntities] AS [b] ON [c].[ParentId] = [b].[Id] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [b].[Id] +ORDER BY [c].[Id] """, // """ -SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [c].[Id], [b].[Id] +SELECT [b2].[BaseInheritanceRelationshipEntityId], [b2].[Id], [b2].[Name], [c].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN [BaseEntities] AS [b] ON [c].[ParentId] = [b].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b2] ON [b].[Id] = [b2].[BaseInheritanceRelationshipEntityId] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [b].[Id] +ORDER BY [c].[Id] """, // """ -SELECT [b3].[DerivedInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [c].[Id], [b].[Id] +SELECT [b3].[DerivedInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [c].[Id] FROM [CollectionsOnBase] AS [c] LEFT JOIN [BaseEntities] AS [b] ON [c].[ParentId] = [b].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b3] ON [b].[Id] = [b3].[DerivedInheritanceRelationshipEntityId] WHERE [c].[Name] <> N'Bar' OR [c].[Name] IS NULL -ORDER BY [c].[Id], [b].[Id] +ORDER BY [c].[Id] """); } @@ -1179,11 +1179,11 @@ LEFT JOIN ( FROM [BaseEntities] AS [b0] WHERE [b0].[Discriminator] = N'DerivedInheritanceRelationshipEntity' ) AS [b1] ON [b].[ParentId] = [b1].[Id] -ORDER BY [b].[Id], [b1].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [b4].[BaseInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [b].[Id], [b1].[Id] +SELECT [b4].[BaseInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [b].[Id] FROM [BaseCollectionsOnDerived] AS [b] LEFT JOIN ( SELECT [b0].[Id] @@ -1191,11 +1191,11 @@ FROM [BaseEntities] AS [b0] WHERE [b0].[Discriminator] = N'DerivedInheritanceRelationshipEntity' ) AS [b1] ON [b].[ParentId] = [b1].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b4] ON [b1].[Id] = [b4].[BaseInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [b1].[Id] +ORDER BY [b].[Id] """, // """ -SELECT [b5].[DerivedInheritanceRelationshipEntityId], [b5].[Id], [b5].[Name], [b].[Id], [b1].[Id] +SELECT [b5].[DerivedInheritanceRelationshipEntityId], [b5].[Id], [b5].[Name], [b].[Id] FROM [BaseCollectionsOnDerived] AS [b] LEFT JOIN ( SELECT [b0].[Id] @@ -1203,7 +1203,7 @@ FROM [BaseEntities] AS [b0] WHERE [b0].[Discriminator] = N'DerivedInheritanceRelationshipEntity' ) AS [b1] ON [b].[ParentId] = [b1].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b5] ON [b1].[Id] = [b5].[DerivedInheritanceRelationshipEntityId] -ORDER BY [b].[Id], [b1].[Id] +ORDER BY [b].[Id] """); } @@ -1295,25 +1295,25 @@ public override async Task Nested_include_with_inheritance_reference_collection_ FROM [NestedCollections] AS [n] LEFT JOIN [BaseReferencesOnBase] AS [b] ON [n].[ParentReferenceId] = [b].[Id] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] -ORDER BY [n].[Id], [b].[Id], [b0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [n].[Id], [b].[Id], [b0].[Id] +SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [n].[Id] FROM [NestedCollections] AS [n] LEFT JOIN [BaseReferencesOnBase] AS [b] ON [n].[ParentReferenceId] = [b].[Id] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b3] ON [b0].[Id] = [b3].[BaseInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [n].[Id], [b].[Id], [b0].[Id] +SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [n].[Id] FROM [NestedCollections] AS [n] LEFT JOIN [BaseReferencesOnBase] AS [b] ON [n].[ParentReferenceId] = [b].[Id] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b4] ON [b0].[Id] = [b4].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id] +ORDER BY [n].[Id] """); } @@ -1364,25 +1364,25 @@ public override async Task Nested_include_with_inheritance_collection_reference_ FROM [NestedReferences] AS [n] LEFT JOIN [BaseCollectionsOnBase] AS [b] ON [n].[ParentCollectionId] = [b].[Id] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] -ORDER BY [n].[Id], [b].[Id], [b0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [n].[Id], [b].[Id], [b0].[Id] +SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [n].[Id] FROM [NestedReferences] AS [n] LEFT JOIN [BaseCollectionsOnBase] AS [b] ON [n].[ParentCollectionId] = [b].[Id] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b3] ON [b0].[Id] = [b3].[BaseInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [n].[Id], [b].[Id], [b0].[Id] +SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [n].[Id] FROM [NestedReferences] AS [n] LEFT JOIN [BaseCollectionsOnBase] AS [b] ON [n].[ParentCollectionId] = [b].[Id] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b4] ON [b0].[Id] = [b4].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id] +ORDER BY [n].[Id] """); } @@ -1437,25 +1437,25 @@ public override async Task Nested_include_with_inheritance_collection_collection FROM [NestedCollections] AS [n] LEFT JOIN [BaseCollectionsOnBase] AS [b] ON [n].[ParentCollectionId] = [b].[Id] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] -ORDER BY [n].[Id], [b].[Id], [b0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [n].[Id], [b].[Id], [b0].[Id] +SELECT [b3].[BaseInheritanceRelationshipEntityId], [b3].[Id], [b3].[Name], [n].[Id] FROM [NestedCollections] AS [n] LEFT JOIN [BaseCollectionsOnBase] AS [b] ON [n].[ParentCollectionId] = [b].[Id] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b3] ON [b0].[Id] = [b3].[BaseInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id] +ORDER BY [n].[Id] """, // """ -SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [n].[Id], [b].[Id], [b0].[Id] +SELECT [b4].[DerivedInheritanceRelationshipEntityId], [b4].[Id], [b4].[Name], [n].[Id] FROM [NestedCollections] AS [n] LEFT JOIN [BaseCollectionsOnBase] AS [b] ON [n].[ParentCollectionId] = [b].[Id] LEFT JOIN [BaseEntities] AS [b0] ON [b].[BaseParentId] = [b0].[Id] INNER JOIN [BaseEntities_OwnedCollectionOnDerived] AS [b4] ON [b0].[Id] = [b4].[DerivedInheritanceRelationshipEntityId] -ORDER BY [n].[Id], [b].[Id], [b0].[Id] +ORDER BY [n].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyNoTrackingQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyNoTrackingQuerySqlServerTest.cs index fe73be2f481..23afcca6f0b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyNoTrackingQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyNoTrackingQuerySqlServerTest.cs @@ -370,7 +370,7 @@ FROM [EntityRoots] AS [e0] WHERE [e0].[Discriminator] = N'EntityLeaf' ) AS [e1] ON [j].[LeafId] = [e1].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeId1] AND [e].[Key2] = [s].[CompositeId2] AND [e].[Key3] = [s].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2] """); } @@ -388,7 +388,7 @@ FROM [EntityCompositeKeyEntityRoot] AS [e0] INNER JOIN [EntityRoots] AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] WHERE [e1].[Discriminator] = N'EntityLeaf' ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -574,7 +574,7 @@ LEFT JOIN ( FROM [JoinOneSelfPayload] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[LeftId] = [e0].[Id] ) AS [s] ON [e].[Id] = [s].[RightId] -ORDER BY [e].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [e].[Id], [s].[LeftId] """); } @@ -601,7 +601,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e3] INNER JOIN [EntityCompositeKeys] AS [e4] ON [e3].[CompositeKeySkipSharedKey1] = [e4].[Key1] AND [e3].[CompositeKeySkipSharedKey2] = [e4].[Key2] AND [e3].[CompositeKeySkipSharedKey3] = [e4].[Key3] ) AS [s1] ON [e].[Id] = [s1].[TwoSkipSharedId] -ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s].[Id], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s0].[Id], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2] +ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2] """); } @@ -639,7 +639,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityRoot] AS [e0] INNER JOIN [EntityRoots] AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -657,7 +657,7 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """); } @@ -683,7 +683,7 @@ FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[EntityOneId] = [e2].[Id] ) AS [s] ON [e1].[Id] = [s].[EntityBranchId] ) AS [s0] ON [e].[Key1] = [s0].[CompositeId1] AND [e].[Key2] = [s0].[CompositeId2] AND [e].[Key3] = [s0].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id], [s0].[EntityBranchId], [s0].[EntityOneId] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[EntityBranchId] """); } @@ -706,7 +706,7 @@ FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s] ON [e0].[Id] = [s].[LeftId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -724,7 +724,7 @@ LEFT JOIN ( FROM [EntityOneEntityTwo] AS [e1] INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] ) AS [s] ON [e].[Id] = [s].[TwoSkipSharedId] -ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId] """); } @@ -742,7 +742,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -845,7 +845,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] WHERE [e2].[Id] < 10 ) AS [s] ON [e1].[Id] = [s].[ThreeId] ) AS [s0] ON [e].[Id] = [s0].[RootSkipSharedId] -ORDER BY [e].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[Id], [s0].[OneId], [s0].[ThreeId] +ORDER BY [e].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[OneId] """); } @@ -871,7 +871,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] WHERE 1 < [s].[row] AND [s].[row] <= 3 ) AS [s0] ON [e1].[Key1] = [s0].[CompositeId1] AND [e1].[Key2] = [s0].[CompositeId2] AND [e1].[Key3] = [s0].[CompositeId3] ) AS [s1] ON [e].[Id] = [s1].[RootSkipSharedId] -ORDER BY [e].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2], [s1].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] +ORDER BY [e].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] """); } @@ -895,7 +895,7 @@ FROM [EntityCompositeKeyEntityTwo] AS [e1] WHERE [e0].[Key1] < 5 ) AS [s0] ON [e].[Id] = [s0].[LeafId] WHERE [e].[Discriminator] = N'EntityLeaf' -ORDER BY [e].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -924,7 +924,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -951,7 +951,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] ON [e0].[Id] = [s0].[TwoId] WHERE [e0].[Id] < 10 ) AS [s1] ON [e].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[Id], [s1].[TwoId0], [s1].[Id0] +ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[TwoId0], [s1].[Id0] """); } @@ -971,7 +971,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1008,7 +1008,7 @@ WHERE [e3].[Id] < 20 ) AS [s1] ON [e0].[Id] = [s1].[EntityOneId] WHERE [e0].[Id] < 10 ) AS [s2] ON [e].[Id] = [s2].[ThreeId] -ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[Id], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId], [s2].[EntityOneId] +ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId] """); } @@ -1031,7 +1031,7 @@ WHERE [e1].[Id] < 5 ) AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1054,7 +1054,7 @@ WHERE [e1].[Id] < 5 ) AS [s] ON [e0].[Id] = [s].[TwoId] WHERE [e0].[Id] > 15 ) AS [s0] ON [e].[Id] = [s0].[CollectionInverseId] -ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId], [s0].[TwoId] +ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId] """); } @@ -1142,11 +1142,11 @@ FROM [EntityRoots] AS [e0] WHERE [e0].[Discriminator] = N'EntityLeaf' ) AS [e1] ON [j].[LeafId] = [e1].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeId1] AND [e].[Key2] = [s].[CompositeId2] AND [e].[Key3] = [s].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[Id], [s0].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +SELECT [s0].[Id], [s0].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [EntityCompositeKeys] AS [e] INNER JOIN ( SELECT [e1].[Id], [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3] @@ -1162,7 +1162,7 @@ INNER JOIN ( FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[EntityOneId] = [e2].[Id] ) AS [s0] ON [s].[Id] = [s0].[EntityBranchId] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1186,11 +1186,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """, // """ -SELECT [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +SELECT [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [e1].[Id] AS [Id0], [j].[OneId], [j].[ThreeId] @@ -1203,7 +1203,7 @@ INNER JOIN ( FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s0] ON [s].[Id] = [s0].[LeftId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """); } @@ -1379,11 +1379,11 @@ INNER JOIN ( FROM [EntityRootEntityThree] AS [e0] INNER JOIN [EntityThrees] AS [e1] ON [e0].[ThreeSkipSharedId] = [e1].[Id] ) AS [s] ON [e].[Id] = [s].[RootSkipSharedId] -ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """, // """ -SELECT [s0].[Id], [s0].[Name], [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +SELECT [s0].[Id], [s0].[Name], [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] FROM [EntityRoots] AS [e] INNER JOIN ( SELECT [e1].[Id], [e0].[RootSkipSharedId], [e0].[ThreeSkipSharedId] @@ -1396,7 +1396,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e2] ON [j].[OneId] = [e2].[Id] WHERE [e2].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """); } @@ -1419,11 +1419,11 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityRoot] AS [e0] INNER JOIN [EntityCompositeKeys] AS [e1] ON [e0].[CompositeKeySkipSharedKey1] = [e1].[Key1] AND [e0].[CompositeKeySkipSharedKey2] = [e1].[Key2] AND [e0].[CompositeKeySkipSharedKey3] = [e1].[Key3] ) AS [s] ON [e].[Id] = [s].[RootSkipSharedId] -ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] FROM [EntityRoots] AS [e] INNER JOIN ( SELECT [e1].[Key1], [e1].[Key2], [e1].[Key3], [e0].[RootSkipSharedId], [e0].[CompositeKeySkipSharedKey1], [e0].[CompositeKeySkipSharedKey2], [e0].[CompositeKeySkipSharedKey3] @@ -1439,7 +1439,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Key1] = [s1].[CompositeId1] AND [s].[Key2] = [s1].[CompositeId2] AND [s].[Key3] = [s1].[CompositeId3] -ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] +ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id] """); } @@ -1465,11 +1465,11 @@ FROM [JoinCompositeKeyToLeaf] AS [j] WHERE [e0].[Key1] < 5 ) AS [s] ON [e].[Id] = [s].[LeafId] WHERE [e].[Discriminator] = N'EntityLeaf' -ORDER BY [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [EntityRoots] AS [e] INNER JOIN ( SELECT [e0].[Key1], [e0].[Key2], [e0].[Key3], [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3] @@ -1483,7 +1483,7 @@ FROM [EntityCompositeKeyEntityTwo] AS [e1] INNER JOIN [EntityTwos] AS [e2] ON [e1].[TwoSkipSharedId] = [e2].[Id] ) AS [s0] ON [s].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [s].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [s].[Key3] = [s0].[CompositeKeySkipSharedKey3] WHERE [e].[Discriminator] = N'EntityLeaf' -ORDER BY [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1514,7 +1514,7 @@ FROM [JoinOneToTwo] AS [j] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId], [s0].[Id] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [s].[Id], [s].[OneId], [s].[TwoId] @@ -1555,11 +1555,11 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityTwos] AS [e0] ON [j].[TwoId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[TwoId] @@ -1576,7 +1576,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s1].[TwoId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s1].[TwoId], [s1].[Id] """); } @@ -1601,11 +1601,11 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] FROM [EntityTwos] AS [e] INNER JOIN ( SELECT [e0].[Id], [e1].[Id] AS [Id0], [j].[OneId], [j].[TwoId] @@ -1615,7 +1615,7 @@ FROM [JoinOneToTwo] AS [j] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] INNER JOIN [EntityTwos] AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1639,11 +1639,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [s1].[Id], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[ThreeId] @@ -1660,11 +1660,11 @@ FROM [JoinOneToTwo] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s1].[OneId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s1].[OneId], [s1].[Id] """, // """ -SELECT [s2].[Id], [s2].[Discriminator], [s2].[Name], [s2].[Number], [s2].[IsGreen], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [s2].[Id], [s2].[Discriminator], [s2].[Name], [s2].[Number], [s2].[IsGreen], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[ThreeId] @@ -1682,7 +1682,7 @@ WHERE [e2].[Discriminator] IN (N'EntityBranch', N'EntityLeaf') ) AS [e3] ON [j1].[EntityBranchId] = [e3].[Id] WHERE [e3].[Id] < 20 ) AS [s2] ON [s].[Id] = [s2].[EntityOneId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1706,11 +1706,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [e0].[Id], [j].[OneId], [j].[ThreeId] @@ -1723,7 +1723,7 @@ INNER JOIN ( FROM [EntityTwos] AS [e1] WHERE [e1].[Id] < 5 ) AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs index 2542abbca90..dfa8366fb8d 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs @@ -369,7 +369,7 @@ FROM [EntityRoots] AS [e0] WHERE [e0].[Discriminator] = N'EntityLeaf' ) AS [e1] ON [j].[LeafId] = [e1].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeId1] AND [e].[Key2] = [s].[CompositeId2] AND [e].[Key3] = [s].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2] """); } @@ -387,7 +387,7 @@ FROM [EntityCompositeKeyEntityRoot] AS [e0] INNER JOIN [EntityRoots] AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] WHERE [e1].[Discriminator] = N'EntityLeaf' ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -573,7 +573,7 @@ LEFT JOIN ( FROM [JoinOneSelfPayload] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[LeftId] = [e0].[Id] ) AS [s] ON [e].[Id] = [s].[RightId] -ORDER BY [e].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [e].[Id], [s].[LeftId] """); } @@ -600,7 +600,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityTwo] AS [e3] INNER JOIN [EntityCompositeKeys] AS [e4] ON [e3].[CompositeKeySkipSharedKey1] = [e4].[Key1] AND [e3].[CompositeKeySkipSharedKey2] = [e4].[Key2] AND [e3].[CompositeKeySkipSharedKey3] = [e4].[Key3] ) AS [s1] ON [e].[Id] = [s1].[TwoSkipSharedId] -ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s].[Id], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s0].[Id], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2] +ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2] """); } @@ -638,7 +638,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityRoot] AS [e0] INNER JOIN [EntityRoots] AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -656,7 +656,7 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """); } @@ -682,7 +682,7 @@ FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[EntityOneId] = [e2].[Id] ) AS [s] ON [e1].[Id] = [s].[EntityBranchId] ) AS [s0] ON [e].[Key1] = [s0].[CompositeId1] AND [e].[Key2] = [s0].[CompositeId2] AND [e].[Key3] = [s0].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id], [s0].[EntityBranchId], [s0].[EntityOneId] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[EntityBranchId] """); } @@ -705,7 +705,7 @@ FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s] ON [e0].[Id] = [s].[LeftId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -723,7 +723,7 @@ LEFT JOIN ( FROM [EntityOneEntityTwo] AS [e1] INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] ) AS [s] ON [e].[Id] = [s].[TwoSkipSharedId] -ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId] """); } @@ -741,7 +741,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -844,7 +844,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] WHERE [e2].[Id] < 10 ) AS [s] ON [e1].[Id] = [s].[ThreeId] ) AS [s0] ON [e].[Id] = [s0].[RootSkipSharedId] -ORDER BY [e].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[Id], [s0].[OneId], [s0].[ThreeId] +ORDER BY [e].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[OneId] """); } @@ -870,7 +870,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] WHERE 1 < [s].[row] AND [s].[row] <= 3 ) AS [s0] ON [e1].[Key1] = [s0].[CompositeId1] AND [e1].[Key2] = [s0].[CompositeId2] AND [e1].[Key3] = [s0].[CompositeId3] ) AS [s1] ON [e].[Id] = [s1].[RootSkipSharedId] -ORDER BY [e].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2], [s1].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] +ORDER BY [e].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] """); } @@ -894,7 +894,7 @@ FROM [EntityCompositeKeyEntityTwo] AS [e1] WHERE [e0].[Key1] < 5 ) AS [s0] ON [e].[Id] = [s0].[LeafId] WHERE [e].[Discriminator] = N'EntityLeaf' -ORDER BY [e].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -923,7 +923,7 @@ FROM [JoinTwoToThree] AS [j0] WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -950,7 +950,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] ON [e0].[Id] = [s0].[TwoId] WHERE [e0].[Id] < 10 ) AS [s1] ON [e].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[Id], [s1].[TwoId0], [s1].[Id0] +ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[TwoId0], [s1].[Id0] """); } @@ -970,7 +970,7 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1007,7 +1007,7 @@ WHERE [e3].[Id] < 20 ) AS [s1] ON [e0].[Id] = [s1].[EntityOneId] WHERE [e0].[Id] < 10 ) AS [s2] ON [e].[Id] = [s2].[ThreeId] -ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[Id], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId], [s2].[EntityOneId] +ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId] """); } @@ -1030,7 +1030,7 @@ WHERE [e1].[Id] < 5 ) AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1053,7 +1053,7 @@ WHERE [e1].[Id] < 5 ) AS [s] ON [e0].[Id] = [s].[TwoId] WHERE [e0].[Id] > 15 ) AS [s0] ON [e].[Id] = [s0].[CollectionInverseId] -ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId], [s0].[TwoId] +ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId] """); } @@ -1141,11 +1141,11 @@ FROM [EntityRoots] AS [e0] WHERE [e0].[Discriminator] = N'EntityLeaf' ) AS [e1] ON [j].[LeafId] = [e1].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeId1] AND [e].[Key2] = [s].[CompositeId2] AND [e].[Key3] = [s].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[EntityBranchId], [s0].[EntityOneId], [s0].[Id], [s0].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +SELECT [s0].[EntityBranchId], [s0].[EntityOneId], [s0].[Id], [s0].[Name], [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [EntityCompositeKeys] AS [e] INNER JOIN ( SELECT [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [e1].[Id] @@ -1161,7 +1161,7 @@ INNER JOIN ( FROM [JoinOneToBranch] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[EntityOneId] = [e2].[Id] ) AS [s0] ON [s].[Id] = [s0].[EntityBranchId] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Id] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1185,11 +1185,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """, // """ -SELECT [s0].[LeftId], [s0].[RightId], [s0].[Payload], [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +SELECT [s0].[LeftId], [s0].[RightId], [s0].[Payload], [s0].[Id], [s0].[Name], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id], [e1].[Id] AS [Id0] @@ -1202,7 +1202,7 @@ INNER JOIN ( FROM [JoinOneSelfPayload] AS [j0] INNER JOIN [EntityOnes] AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s0] ON [s].[Id] = [s0].[LeftId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id0] """); } @@ -1378,11 +1378,11 @@ INNER JOIN ( FROM [EntityRootEntityThree] AS [e0] INNER JOIN [EntityThrees] AS [e1] ON [e0].[ThreeSkipSharedId] = [e1].[Id] ) AS [s] ON [e].[Id] = [s].[RootSkipSharedId] -ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """, // """ -SELECT [s0].[OneId], [s0].[ThreeId], [s0].[Payload], [s0].[Id], [s0].[Name], [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +SELECT [s0].[OneId], [s0].[ThreeId], [s0].[Payload], [s0].[Id], [s0].[Name], [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] FROM [EntityRoots] AS [e] INNER JOIN ( SELECT [e0].[RootSkipSharedId], [e0].[ThreeSkipSharedId], [e1].[Id] @@ -1395,7 +1395,7 @@ FROM [JoinOneToThreePayloadFullShared] AS [j] INNER JOIN [EntityOnes] AS [e2] ON [j].[OneId] = [e2].[Id] WHERE [e2].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId], [s].[Id] +ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[ThreeSkipSharedId] """); } @@ -1418,11 +1418,11 @@ INNER JOIN ( FROM [EntityCompositeKeyEntityRoot] AS [e0] INNER JOIN [EntityCompositeKeys] AS [e1] ON [e0].[CompositeKeySkipSharedKey1] = [e1].[Key1] AND [e0].[CompositeKeySkipSharedKey2] = [e1].[Key2] AND [e0].[CompositeKeySkipSharedKey3] = [e1].[Key3] ) AS [s] ON [e].[Id] = [s].[RootSkipSharedId] -ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] """, // """ -SELECT [s1].[Id], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[ThreeId], [s1].[Id0], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s1].[Id], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[ThreeId], [s1].[Id0], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] FROM [EntityRoots] AS [e] INNER JOIN ( SELECT [e0].[RootSkipSharedId], [e0].[CompositeKeySkipSharedKey1], [e0].[CompositeKeySkipSharedKey2], [e0].[CompositeKeySkipSharedKey3], [e1].[Key1], [e1].[Key2], [e1].[Key3] @@ -1438,7 +1438,7 @@ FROM [JoinThreeToCompositeKeyFull] AS [j] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Key1] = [s1].[CompositeId1] AND [s].[Key2] = [s1].[CompositeId2] AND [s].[Key3] = [s1].[CompositeId3] -ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s].[Key1], [s].[Key2], [s].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] +ORDER BY [e].[Id], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] """); } @@ -1464,11 +1464,11 @@ FROM [JoinCompositeKeyToLeaf] AS [j] WHERE [e0].[Key1] < 5 ) AS [s] ON [e].[Id] = [s].[LeafId] WHERE [e].[Discriminator] = N'EntityLeaf' -ORDER BY [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """, // """ -SELECT [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3], [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +SELECT [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3], [s0].[Id], [s0].[CollectionInverseId], [s0].[ExtraId], [s0].[Name], [s0].[ReferenceInverseId], [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] FROM [EntityRoots] AS [e] INNER JOIN ( SELECT [j].[LeafId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [e0].[Key1], [e0].[Key2], [e0].[Key3] @@ -1482,7 +1482,7 @@ FROM [EntityCompositeKeyEntityTwo] AS [e1] INNER JOIN [EntityTwos] AS [e2] ON [e1].[TwoSkipSharedId] = [e2].[Id] ) AS [s0] ON [s].[Key1] = [s0].[CompositeKeySkipSharedKey1] AND [s].[Key2] = [s0].[CompositeKeySkipSharedKey2] AND [s].[Key3] = [s0].[CompositeKeySkipSharedKey3] WHERE [e].[Discriminator] = N'EntityLeaf' -ORDER BY [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3], [s].[Key1], [s].[Key2], [s].[Key3] +ORDER BY [e].[Id], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] """); } @@ -1513,7 +1513,7 @@ FROM [JoinOneToTwo] AS [j] """, // """ -SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId], [s0].[Id] +SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s0].[OneId], [s0].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [s].[OneId], [s].[TwoId], [s].[Id] @@ -1554,11 +1554,11 @@ FROM [JoinOneToTwo] AS [j] INNER JOIN [EntityTwos] AS [e0] ON [j].[TwoId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """, // """ -SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +SELECT [s1].[ThreeId], [s1].[TwoId], [s1].[Id], [s1].[CollectionInverseId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId] FROM [EntityOnes] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[TwoId], [e0].[Id] @@ -1575,7 +1575,7 @@ FROM [JoinTwoToThree] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s1].[TwoId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s1].[TwoId], [s1].[Id] """); } @@ -1600,11 +1600,11 @@ FROM [JoinOneToTwo] AS [j] LEFT JOIN [EntityTwos] AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] FROM [EntityTwos] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[TwoId], [e0].[Id], [e1].[Id] AS [Id0] @@ -1614,7 +1614,7 @@ FROM [JoinOneToTwo] AS [j] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] INNER JOIN [EntityTwos] AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1638,11 +1638,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [s1].[OneId], [s1].[TwoId], [s1].[JoinOneToTwoExtraId], [s1].[Id], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [s1].[OneId], [s1].[TwoId], [s1].[JoinOneToTwoExtraId], [s1].[Id], [s1].[CollectionInverseId], [s1].[ExtraId], [s1].[Name], [s1].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id] @@ -1659,11 +1659,11 @@ FROM [JoinOneToTwo] AS [j0] ) AS [s0] WHERE 1 < [s0].[row] AND [s0].[row] <= 3 ) AS [s1] ON [s].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id], [s1].[OneId], [s1].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s1].[OneId], [s1].[Id] """, // """ -SELECT [s2].[EntityBranchId], [s2].[EntityOneId], [s2].[Id], [s2].[Discriminator], [s2].[Name], [s2].[Number], [s2].[IsGreen], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [s2].[EntityBranchId], [s2].[EntityOneId], [s2].[Id], [s2].[Discriminator], [s2].[Name], [s2].[Number], [s2].[IsGreen], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id] @@ -1681,7 +1681,7 @@ WHERE [e2].[Discriminator] IN (N'EntityBranch', N'EntityLeaf') ) AS [e3] ON [j1].[EntityBranchId] = [e3].[Id] WHERE [e3].[Id] < 20 ) AS [s2] ON [s].[Id] = [s2].[EntityOneId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1705,11 +1705,11 @@ FROM [JoinOneToThreePayloadFull] AS [j] INNER JOIN [EntityOnes] AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """, // """ -SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[ReferenceInverseId], [e].[Id], [s].[OneId], [s].[ThreeId] FROM [EntityThrees] AS [e] INNER JOIN ( SELECT [j].[OneId], [j].[ThreeId], [e0].[Id] @@ -1722,7 +1722,7 @@ INNER JOIN ( FROM [EntityTwos] AS [e1] WHERE [e1].[Id] < 5 ) AS [e2] ON [s].[Id] = [e2].[CollectionInverseId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAsNoTrackingQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAsNoTrackingQuerySqlServerTest.cs index 17cc4dd1b7b..4cfbc4fe1ed 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAsNoTrackingQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAsNoTrackingQuerySqlServerTest.cs @@ -119,7 +119,7 @@ public override async Task Include_reference_and_collection(bool async) FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindEFPropertyIncludeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindEFPropertyIncludeQuerySqlServerTest.cs index fbe0bf0f43f..7eaf99fc82c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindEFPropertyIncludeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindEFPropertyIncludeQuerySqlServerTest.cs @@ -67,7 +67,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -219,7 +219,7 @@ FROM [Orders] AS [o] WHERE [o].[OrderID] = 10248 ) AS [s] LEFT JOIN [Orders] AS [o0] ON [s].[CustomerID0] = [o0].[CustomerID] -ORDER BY [s].[OrderID], [s].[CustomerID0] +ORDER BY [s].[OrderID] """); } @@ -234,7 +234,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -414,9 +414,9 @@ public override async Task Repro9735(bool async) """ @p='2' -SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [s].[CustomerID0], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] +SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] FROM ( - SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] AS [CustomerID0], CASE + SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], CASE WHEN [c].[CustomerID] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -434,7 +434,7 @@ ELSE N'' END ) AS [s] LEFT JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID0], [o0].[OrderID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID], [o0].[OrderID] """); } @@ -563,7 +563,7 @@ FROM [Order Details] AS [o0] ) AS [s] ON [o].[OrderID] = [s].[OrderID] ) AS [s0] ON [c].[CustomerID] = [s0].[CustomerID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] +ORDER BY [c].[CustomerID], [s0].[OrderID], [s0].[OrderID0] """); } @@ -798,7 +798,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -816,7 +816,7 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] ) AS [s] ON [p].[ProductID] = [s].[ProductID] WHERE [p].[ProductID] % 17 = 5 -ORDER BY [p].[ProductID], [s].[OrderID], [s].[ProductID] +ORDER BY [p].[ProductID], [s].[OrderID] """); } @@ -932,7 +932,7 @@ LEFT JOIN ( FROM [Order Details] AS [o0] INNER JOIN [Products] AS [p] ON [o0].[ProductID] = [p].[ProductID] ) AS [s] ON [o1].[OrderID] = [s].[OrderID] -ORDER BY [o1].[OrderID], [s].[OrderID], [s].[ProductID] +ORDER BY [o1].[OrderID], [s].[OrderID] """); } @@ -998,7 +998,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 AND [o].[UnitPrice] < 10.0 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1054,7 +1054,7 @@ FROM [Orders] AS [o] ) AS [o2] ON [c].[CustomerID] = [o2].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o2].[OrderID] = [o0].[OrderID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [o2].[OrderID], [o0].[OrderID] +ORDER BY [c].[CustomerID], [o0].[OrderID] """); } @@ -1098,9 +1098,9 @@ public override async Task Include_collection_with_multiple_conditional_order_by """ @p='5' -SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [s].[CustomerID0], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] +SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] FROM ( - SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] AS [CustomerID0], CASE + SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], CASE WHEN [o].[OrderID] > 0 THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -1118,7 +1118,7 @@ ELSE N'' END ) AS [s] LEFT JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID0], [o0].[OrderID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID], [o0].[OrderID] """); } @@ -1172,7 +1172,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -1188,7 +1188,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[ProductID] % 23 = 17 AND [o].[Quantity] < CAST(10 AS smallint) -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1265,14 +1265,14 @@ public override async Task Include_multiple_references_then_include_collection_m AssertSql( """ -SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [p].[ProductID], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] +SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[ProductID], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1325,7 +1325,7 @@ public override async Task Include_collection_SelectMany_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1334,9 +1334,9 @@ CROSS JOIN [Order Details] AS [o0] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] CROSS JOIN [Order Details] AS [o2] WHERE [o1].[OrderID] = 10248 @@ -1344,7 +1344,7 @@ CROSS JOIN [Order Details] AS [o2] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1526,7 +1526,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1577,7 +1577,7 @@ public override async Task Include_collection_Join_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1586,9 +1586,9 @@ FROM [Orders] AS [o] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] INNER JOIN [Order Details] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 @@ -1596,7 +1596,7 @@ FROM [Orders] AS [o1] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1623,7 +1623,7 @@ FROM [Orders] AS [o0] WHERE [o3].[row] <= 1 ) AS [o4] ON [o2].[OrderID] = [o4].[OrderID] LEFT JOIN [Order Details] AS [o1] ON [o4].[OrderID] = [o1].[OrderID] -ORDER BY [o2].[OrderID], [o4].[OrderID], [o1].[OrderID] +ORDER BY [o2].[OrderID], [o1].[OrderID] """); } @@ -1652,7 +1652,7 @@ public override async Task Join_Include_collection_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1661,9 +1661,9 @@ FROM [Order Details] AS [o] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] INNER JOIN [Orders] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 @@ -1671,7 +1671,7 @@ FROM [Order Details] AS [o1] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1735,12 +1735,12 @@ public override async Task Include_collection_and_reference(bool async) AssertSql( """ -SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """); } @@ -1771,7 +1771,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1781,7 +1781,7 @@ public override async Task SelectMany_Include_collection_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1790,9 +1790,9 @@ CROSS JOIN [Orders] AS [o0] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] CROSS JOIN [Orders] AS [o2] WHERE [o1].[OrderID] = 10248 @@ -1800,7 +1800,7 @@ CROSS JOIN [Orders] AS [o2] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1868,7 +1868,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """); } @@ -1939,7 +1939,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2022,7 +2022,7 @@ FROM [Orders] AS [o] WHERE [o].[OrderID] = 10248 ) AS [s] LEFT JOIN [Orders] AS [o0] ON [s].[CustomerID0] = [o0].[CustomerID] -ORDER BY [s].[OrderID], [s].[CustomerID0] +ORDER BY [s].[OrderID] """); } @@ -2032,14 +2032,14 @@ public override async Task Include_multiple_references_and_collection_multi_leve AssertSql( """ -SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [p].[ProductID], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] +SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[ProductID], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2112,7 +2112,7 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] ) AS [s] ON [p].[ProductID] = [s].[ProductID] WHERE [p].[ProductID] % 17 = 5 AND [p].[UnitPrice] < 20.0 -ORDER BY [p].[ProductID], [s].[OrderID], [s].[ProductID] +ORDER BY [p].[ProductID], [s].[OrderID] """); } @@ -2141,7 +2141,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindGroupByQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindGroupByQuerySqlServerTest.cs index 869ced1f79d..1da6012bd65 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindGroupByQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindGroupByQuerySqlServerTest.cs @@ -1378,7 +1378,6 @@ public override async Task GroupJoin_GroupBy_Aggregate_3(bool async) """ SELECT [o].[CustomerID] AS [Key], AVG(CAST([o].[OrderID] AS float)) AS [Average] FROM [Orders] AS [o] -LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] GROUP BY [o].[CustomerID] """); } @@ -1404,7 +1403,6 @@ public override async Task GroupJoin_GroupBy_Aggregate_5(bool async) """ SELECT [o].[OrderID] AS [Value], AVG(CAST([o].[OrderID] AS float)) AS [Average] FROM [Orders] AS [o] -LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] GROUP BY [o].[OrderID] """); } @@ -1828,12 +1826,6 @@ public override async Task GroupBy_Aggregate_LeftJoin_converted_from_SelectMany( """ SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] FROM [Customers] AS [c] -LEFT JOIN ( - SELECT [o].[CustomerID] - FROM [Orders] AS [o] - GROUP BY [o].[CustomerID] - HAVING COUNT(*) > 5 -) AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] """); } @@ -3365,7 +3357,6 @@ public override async Task Key_plus_key_in_projection(bool async) """ SELECT [o].[OrderID] + [o].[OrderID] AS [Value], AVG(CAST([o].[OrderID] AS float)) AS [Average] FROM [Orders] AS [o] -LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] GROUP BY [o].[OrderID] """); } @@ -3427,7 +3418,7 @@ FROM [Orders] AS [o0] ) AS [o3] ON [o1].[CustomerID] = [o3].[CustomerID] ) AS [s] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [s].[CustomerID0] +ORDER BY [c].[CustomerID] """); } @@ -3891,7 +3882,7 @@ public override async Task GroupBy_complex_key_without_aggregate(bool async) AssertSql( """ -SELECT [s1].[Key], [s3].[OrderID], [s3].[CustomerID], [s3].[EmployeeID], [s3].[OrderDate], [s3].[CustomerID0] +SELECT [s1].[Key], [s3].[OrderID], [s3].[CustomerID], [s3].[EmployeeID], [s3].[OrderDate] FROM ( SELECT [s].[Key] FROM ( @@ -3902,18 +3893,18 @@ FROM [Orders] AS [o] GROUP BY [s].[Key] ) AS [s1] LEFT JOIN ( - SELECT [s2].[OrderID], [s2].[CustomerID], [s2].[EmployeeID], [s2].[OrderDate], [s2].[CustomerID0], [s2].[Key] + SELECT [s2].[OrderID], [s2].[CustomerID], [s2].[EmployeeID], [s2].[OrderDate], [s2].[Key] FROM ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[CustomerID0], [s0].[Key], ROW_NUMBER() OVER(PARTITION BY [s0].[Key] ORDER BY [s0].[OrderID], [s0].[CustomerID0]) AS [row] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[Key], ROW_NUMBER() OVER(PARTITION BY [s0].[Key] ORDER BY [s0].[OrderID]) AS [row] FROM ( - SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c0].[CustomerID] AS [CustomerID0], SUBSTRING([c0].[CustomerID], 0 + 1, 1) AS [Key] + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], SUBSTRING([c0].[CustomerID], 0 + 1, 1) AS [Key] FROM [Orders] AS [o0] LEFT JOIN [Customers] AS [c0] ON [o0].[CustomerID] = [c0].[CustomerID] ) AS [s0] ) AS [s2] WHERE 1 < [s2].[row] AND [s2].[row] <= 3 ) AS [s3] ON [s1].[Key] = [s3].[Key] -ORDER BY [s1].[Key], [s3].[OrderID] +ORDER BY [s1].[Key] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeNoTrackingQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeNoTrackingQuerySqlServerTest.cs index 5a6159d1202..774e9ec818c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeNoTrackingQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeNoTrackingQuerySqlServerTest.cs @@ -52,7 +52,7 @@ public override async Task Include_collection_Join_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -61,9 +61,9 @@ FROM [Orders] AS [o] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] INNER JOIN [Order Details] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 @@ -71,7 +71,7 @@ FROM [Orders] AS [o1] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -124,7 +124,7 @@ FROM [Order Details] AS [o0] ) AS [s] ON [o].[OrderID] = [s].[OrderID] ) AS [s0] ON [c].[CustomerID] = [s0].[CustomerID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] +ORDER BY [c].[CustomerID], [s0].[OrderID], [s0].[OrderID0] """); } @@ -139,7 +139,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """); } @@ -221,7 +221,7 @@ LEFT JOIN ( FROM [Order Details] AS [o0] INNER JOIN [Products] AS [p] ON [o0].[ProductID] = [p].[ProductID] ) AS [s] ON [o1].[OrderID] = [s].[OrderID] -ORDER BY [o1].[OrderID], [s].[OrderID], [s].[ProductID] +ORDER BY [o1].[OrderID], [s].[OrderID] """); } @@ -495,7 +495,7 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] ) AS [s] ON [p].[ProductID] = [s].[ProductID] WHERE [p].[ProductID] % 17 = 5 AND [p].[UnitPrice] < 20.0 -ORDER BY [p].[ProductID], [s].[OrderID], [s].[ProductID] +ORDER BY [p].[ProductID], [s].[OrderID] """); } @@ -628,9 +628,9 @@ public override async Task Include_collection_with_multiple_conditional_order_by """ @p='5' -SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [s].[CustomerID0], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] +SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] FROM ( - SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] AS [CustomerID0], CASE + SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], CASE WHEN [o].[OrderID] > 0 THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -648,7 +648,7 @@ ELSE N'' END ) AS [s] LEFT JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID0], [o0].[OrderID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID], [o0].[OrderID] """); } @@ -903,7 +903,7 @@ FROM [Orders] AS [o0] WHERE [o3].[row] <= 1 ) AS [o4] ON [o2].[OrderID] = [o4].[OrderID] LEFT JOIN [Order Details] AS [o1] ON [o4].[OrderID] = [o1].[OrderID] -ORDER BY [o2].[OrderID], [o4].[OrderID], [o1].[OrderID] +ORDER BY [o2].[OrderID], [o1].[OrderID] """); } @@ -970,7 +970,7 @@ public override async Task Include_collection_SelectMany_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -979,9 +979,9 @@ CROSS JOIN [Order Details] AS [o0] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] CROSS JOIN [Order Details] AS [o2] WHERE [o1].[OrderID] = 10248 @@ -989,7 +989,7 @@ CROSS JOIN [Order Details] AS [o2] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1016,7 +1016,7 @@ public override async Task Join_Include_collection_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1025,9 +1025,9 @@ FROM [Order Details] AS [o] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] INNER JOIN [Orders] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 @@ -1035,7 +1035,7 @@ FROM [Order Details] AS [o1] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1292,9 +1292,9 @@ public override async Task Repro9735(bool async) """ @p='2' -SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [s].[CustomerID0], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] +SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] FROM ( - SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] AS [CustomerID0], CASE + SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], CASE WHEN [c].[CustomerID] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -1312,7 +1312,7 @@ ELSE N'' END ) AS [s] LEFT JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID0], [o0].[OrderID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID], [o0].[OrderID] """); } @@ -1330,7 +1330,7 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] ) AS [s] ON [p].[ProductID] = [s].[ProductID] WHERE [p].[ProductID] % 17 = 5 -ORDER BY [p].[ProductID], [s].[OrderID], [s].[ProductID] +ORDER BY [p].[ProductID], [s].[OrderID] """); } @@ -1482,12 +1482,12 @@ public override async Task Include_collection_and_reference(bool async) AssertSql( """ -SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """); } @@ -1523,7 +1523,7 @@ FROM [Orders] AS [o] ) AS [o2] ON [c].[CustomerID] = [o2].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o2].[OrderID] = [o0].[OrderID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [o2].[OrderID], [o0].[OrderID] +ORDER BY [c].[CustomerID], [o0].[OrderID] """); } @@ -1620,7 +1620,7 @@ public override async Task SelectMany_Include_collection_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1629,9 +1629,9 @@ CROSS JOIN [Orders] AS [o0] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] CROSS JOIN [Orders] AS [o2] WHERE [o1].[OrderID] = 10248 @@ -1639,7 +1639,7 @@ CROSS JOIN [Orders] AS [o2] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeQuerySqlServerTest.cs index 580b59911c4..d1fa87f8633 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindIncludeQuerySqlServerTest.cs @@ -37,7 +37,7 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] ) AS [s] ON [p].[ProductID] = [s].[ProductID] WHERE [p].[ProductID] % 17 = 5 AND [p].[UnitPrice] < 20.0 -ORDER BY [p].[ProductID], [s].[OrderID], [s].[ProductID] +ORDER BY [p].[ProductID], [s].[OrderID] """); } @@ -170,7 +170,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """); } @@ -185,7 +185,7 @@ public void ToQueryString_for_include_reference_and_collection() FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """, context.Set().Include(o => o.Customer).Include(o => o.OrderDetails).ToQueryString(), ignoreLineEndingDifferences: true, @@ -248,7 +248,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 AND [o].[UnitPrice] < 10.0 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -266,7 +266,7 @@ FROM [Orders] AS [o] WHERE [o].[OrderID] = 10248 ) AS [s] LEFT JOIN [Orders] AS [o0] ON [s].[CustomerID0] = [o0].[CustomerID] -ORDER BY [s].[OrderID], [s].[CustomerID0] +ORDER BY [s].[OrderID] """); } @@ -287,7 +287,7 @@ LEFT JOIN ( FROM [Order Details] AS [o0] INNER JOIN [Products] AS [p] ON [o0].[ProductID] = [p].[ProductID] ) AS [s] ON [o1].[OrderID] = [s].[OrderID] -ORDER BY [o1].[OrderID], [s].[OrderID], [s].[ProductID] +ORDER BY [o1].[OrderID], [s].[OrderID] """); } @@ -529,7 +529,7 @@ FROM [Order Details] AS [o0] ) AS [s] ON [o].[OrderID] = [s].[OrderID] ) AS [s0] ON [c].[CustomerID] = [s0].[CustomerID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] +ORDER BY [c].[CustomerID], [s0].[OrderID], [s0].[OrderID0] """); } @@ -1113,9 +1113,9 @@ public override async Task Include_collection_with_multiple_conditional_order_by """ @p='5' -SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [s].[CustomerID0], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] +SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] FROM ( - SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] AS [CustomerID0], CASE + SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], CASE WHEN [o].[OrderID] > 0 THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -1133,7 +1133,7 @@ ELSE N'' END ) AS [s] LEFT JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID0], [o0].[OrderID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID], [o0].[OrderID] """); } @@ -1207,7 +1207,7 @@ FROM [Orders] AS [o0] WHERE [o3].[row] <= 1 ) AS [o4] ON [o2].[OrderID] = [o4].[OrderID] LEFT JOIN [Order Details] AS [o1] ON [o4].[OrderID] = [o1].[OrderID] -ORDER BY [o2].[OrderID], [o4].[OrderID], [o1].[OrderID] +ORDER BY [o2].[OrderID], [o1].[OrderID] """); } @@ -1243,7 +1243,7 @@ public override async Task Include_collection_Join_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1252,9 +1252,9 @@ FROM [Orders] AS [o] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] INNER JOIN [Order Details] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 @@ -1262,7 +1262,7 @@ FROM [Orders] AS [o1] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1300,7 +1300,7 @@ public override async Task Join_Include_collection_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1309,9 +1309,9 @@ FROM [Order Details] AS [o] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] INNER JOIN [Orders] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 @@ -1319,7 +1319,7 @@ FROM [Order Details] AS [o1] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1355,7 +1355,7 @@ public override async Task Include_collection_SelectMany_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1364,9 +1364,9 @@ CROSS JOIN [Order Details] AS [o0] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] CROSS JOIN [Order Details] AS [o2] WHERE [o1].[OrderID] = 10248 @@ -1374,7 +1374,7 @@ CROSS JOIN [Order Details] AS [o2] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1412,7 +1412,7 @@ public override async Task SelectMany_Include_collection_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1421,9 +1421,9 @@ CROSS JOIN [Orders] AS [o0] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] CROSS JOIN [Orders] AS [o2] WHERE [o1].[OrderID] = 10248 @@ -1431,7 +1431,7 @@ CROSS JOIN [Orders] AS [o2] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1760,7 +1760,7 @@ FROM [Orders] AS [o] ) AS [o2] ON [c].[CustomerID] = [o2].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o2].[OrderID] = [o0].[OrderID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [o2].[OrderID], [o0].[OrderID] +ORDER BY [c].[CustomerID], [o0].[OrderID] """); } @@ -1772,9 +1772,9 @@ public override async Task Repro9735(bool async) """ @p='2' -SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [s].[CustomerID0], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] +SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] FROM ( - SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] AS [CustomerID0], CASE + SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], CASE WHEN [c].[CustomerID] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -1792,7 +1792,7 @@ ELSE N'' END ) AS [s] LEFT JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID0], [o0].[OrderID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID], [o0].[OrderID] """); } @@ -1823,14 +1823,14 @@ public override async Task Include_multiple_references_and_collection_multi_leve AssertSql( """ -SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [p].[ProductID], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] +SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[ProductID], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1893,7 +1893,7 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] ) AS [s] ON [p].[ProductID] = [s].[ProductID] WHERE [p].[ProductID] % 17 = 5 -ORDER BY [p].[ProductID], [s].[OrderID], [s].[ProductID] +ORDER BY [p].[ProductID], [s].[OrderID] """); } @@ -1922,7 +1922,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -1938,7 +1938,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[ProductID] % 23 = 17 AND [o].[Quantity] < CAST(10 AS smallint) -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1984,7 +1984,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1999,7 +1999,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2052,7 +2052,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2062,12 +2062,12 @@ public override async Task Include_collection_and_reference(bool async) AssertSql( """ -SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """); } @@ -2082,7 +2082,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2092,14 +2092,14 @@ public override async Task Include_multiple_references_then_include_collection_m AssertSql( """ -SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [p].[ProductID], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] +SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[ProductID], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2115,7 +2115,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2131,7 +2131,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2149,7 +2149,7 @@ FROM [Orders] AS [o] WHERE [o].[OrderID] = 10248 ) AS [s] LEFT JOIN [Orders] AS [o0] ON [s].[CustomerID0] = [o0].[CustomerID] -ORDER BY [s].[OrderID], [s].[CustomerID0] +ORDER BY [s].[OrderID] """); } @@ -2194,7 +2194,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindJoinQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindJoinQuerySqlServerTest.cs index 5af43749bcc..d13e82df986 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindJoinQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindJoinQuerySqlServerTest.cs @@ -362,7 +362,7 @@ public override async Task Unflattened_GroupJoin_composed_2(bool async) AssertSql( """ -SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [c1].[CustomerID], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c1].[Address], [c1].[City], [c1].[CompanyName], [c1].[ContactName], [c1].[ContactTitle], [c1].[Country], [c1].[Fax], [c1].[Phone], [c1].[PostalCode], [c1].[Region] +SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c1].[CustomerID], [c1].[Address], [c1].[City], [c1].[CompanyName], [c1].[ContactName], [c1].[ContactTitle], [c1].[Country], [c1].[Fax], [c1].[Phone], [c1].[PostalCode], [c1].[Region] FROM [Customers] AS [c] INNER JOIN ( SELECT [c0].[CustomerID], [c0].[Address], [c0].[City], [c0].[CompanyName], [c0].[ContactName], [c0].[ContactTitle], [c0].[Country], [c0].[Fax], [c0].[Phone], [c0].[PostalCode], [c0].[Region] @@ -371,7 +371,7 @@ FROM [Customers] AS [c0] ) AS [c1] ON [c].[CustomerID] = [c1].[CustomerID] LEFT JOIN [Orders] AS [o] ON [c].[CustomerID] = [o].[CustomerID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [c1].[CustomerID] +ORDER BY [c].[CustomerID] """); } @@ -907,7 +907,7 @@ public override async Task Take_in_collection_projection_with_FirstOrDefault_on_ AssertSql( """ -SELECT [c1].[CustomerID], [s].[Title], [s].[OrderID], [s].[CustomerID] +SELECT [c1].[CustomerID], [s].[Title], [s].[OrderID] FROM ( SELECT TOP(1) [c].[CustomerID] FROM [Customers] AS [c] @@ -916,7 +916,7 @@ OUTER APPLY ( SELECT CASE WHEN [o0].[CustomerID] = [c0].[City] OR ([o0].[CustomerID] IS NULL AND [c0].[City] IS NULL) THEN N'A' ELSE N'B' - END AS [Title], [o0].[OrderID], [c0].[CustomerID], [o0].[OrderDate] + END AS [Title], [o0].[OrderID], [o0].[OrderDate] FROM ( SELECT TOP(1) [o].[OrderID], [o].[CustomerID], [o].[OrderDate] FROM [Orders] AS [o] @@ -925,7 +925,7 @@ ORDER BY [o].[OrderDate] ) AS [o0] LEFT JOIN [Customers] AS [c0] ON [o0].[CustomerID] = [c0].[CustomerID] ) AS [s] -ORDER BY [c1].[CustomerID], [s].[OrderDate], [s].[OrderID] +ORDER BY [c1].[CustomerID], [s].[OrderDate] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs index 8104a760aa1..2eb43292c1a 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs @@ -5949,7 +5949,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c0] ON [o].[CustomerID] = [c0].[CustomerID] WHERE [c].[CustomerID] = [o].[CustomerID] ) AS [s] -ORDER BY [c].[CustomerID], [s].[First], [s].[Second] +ORDER BY [c].[CustomerID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindNavigationsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindNavigationsQuerySqlServerTest.cs index fd188f8f064..bfeae0b8e99 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindNavigationsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindNavigationsQuerySqlServerTest.cs @@ -477,12 +477,12 @@ public override async Task Select_collection_navigation_multi_part(bool async) AssertSql( """ -SELECT [o].[OrderID], [c].[CustomerID], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate] +SELECT [o].[OrderID], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[CustomerID] = N'ALFKI' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -492,13 +492,13 @@ public override async Task Select_collection_navigation_multi_part2(bool async) AssertSql( """ -SELECT [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate] +SELECT [o].[OrderID], [o].[ProductID], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o0].[CustomerID] IN (N'ALFKI', N'ANTON') -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -789,7 +789,7 @@ FROM [Customers] AS [c] LEFT JOIN ( SELECT [s].[CustomerID], [s].[Address], [s].[City], [s].[CompanyName], [s].[ContactName], [s].[ContactTitle], [s].[Country], [s].[Fax], [s].[Phone], [s].[PostalCode], [s].[Region], [s].[CustomerID0] FROM ( - SELECT [c0].[CustomerID], [c0].[Address], [c0].[City], [c0].[CompanyName], [c0].[ContactName], [c0].[ContactTitle], [c0].[Country], [c0].[Fax], [c0].[Phone], [c0].[PostalCode], [c0].[Region], [o].[CustomerID] AS [CustomerID0], ROW_NUMBER() OVER(PARTITION BY [o].[CustomerID] ORDER BY [o].[OrderID], [c0].[CustomerID]) AS [row] + SELECT [c0].[CustomerID], [c0].[Address], [c0].[City], [c0].[CompanyName], [c0].[ContactName], [c0].[ContactTitle], [c0].[Country], [c0].[Fax], [c0].[Phone], [c0].[PostalCode], [c0].[Region], [o].[CustomerID] AS [CustomerID0], ROW_NUMBER() OVER(PARTITION BY [o].[CustomerID] ORDER BY [o].[OrderID]) AS [row] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c0] ON [o].[CustomerID] = [c0].[CustomerID] WHERE [o].[OrderID] IN (@orderIds1, @orderIds2, @orderIds3, @orderIds4, @orderIds5, @orderIds6, @orderIds7, @orderIds8, @orderIds9, @orderIds10) diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindQueryFiltersQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindQueryFiltersQuerySqlServerTest.cs index 80ea474b33b..454be9b4098 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindQueryFiltersQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindQueryFiltersQuerySqlServerTest.cs @@ -138,10 +138,10 @@ public override async Task Include_query(bool async) """ @ef_filter__TenantPrefix_startswith='B%' (Size = 40) -SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [s].[CustomerID0] +SELECT [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate] FROM [Customers] AS [c] LEFT JOIN ( - SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c1].[CustomerID] AS [CustomerID0] + SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] LEFT JOIN ( SELECT [c0].[CustomerID], [c0].[CompanyName] @@ -151,7 +151,7 @@ WHERE [c0].[CompanyName] LIKE @ef_filter__TenantPrefix_startswith ESCAPE N'\' WHERE [c1].[CustomerID] IS NOT NULL AND [c1].[CompanyName] IS NOT NULL ) AS [s] ON [c].[CustomerID] = [s].[CustomerID] WHERE [c].[CompanyName] LIKE @ef_filter__TenantPrefix_startswith ESCAPE N'\' -ORDER BY [c].[CustomerID], [s].[OrderID] +ORDER BY [c].[CustomerID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSelectQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSelectQuerySqlServerTest.cs index 495b6b3bd72..23924f7fe9c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSelectQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSelectQuerySqlServerTest.cs @@ -1501,11 +1501,11 @@ public override async Task Select_chained_entity_navigation_doesnt_materialize_i AssertSql( """ -SELECT [o].[OrderID], [c].[CustomerID], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate] +SELECT [o].[OrderID], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2126,7 +2126,7 @@ public override async Task Do_not_erase_projection_mapping_when_adding_single_pr AssertSql( """ -SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[Discontinued], [s].[ProductName], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s1].[OrderID], [s1].[ProductID], [s1].[ProductID0], [s2].[OrderID], [s2].[ProductID], [s2].[Discount], [s2].[Quantity], [s2].[UnitPrice], [s2].[ProductID0], [s2].[Discontinued], [s2].[ProductName], [s2].[SupplierID], [s2].[UnitPrice0], [s2].[UnitsInStock], [s1].[Discount], [s1].[Quantity], [s1].[UnitPrice], [s1].[Discontinued], [s1].[ProductName], [s1].[SupplierID], [s1].[UnitPrice0], [s1].[UnitsInStock] +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[Discontinued], [s].[ProductName], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s2].[OrderID], [s2].[ProductID], [s2].[Discount], [s2].[Quantity], [s2].[UnitPrice], [s2].[ProductID0], [s2].[Discontinued], [s2].[ProductName], [s2].[SupplierID], [s2].[UnitPrice0], [s2].[UnitsInStock], [s1].[OrderID], [s1].[ProductID], [s1].[Discount], [s1].[Quantity], [s1].[UnitPrice], [s1].[ProductID0], [s1].[Discontinued], [s1].[ProductName], [s1].[SupplierID], [s1].[UnitPrice0], [s1].[UnitsInStock] FROM [Orders] AS [o] LEFT JOIN ( SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [p].[ProductID] AS [ProductID0], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice] AS [UnitPrice0], [p].[UnitsInStock] @@ -2136,7 +2136,7 @@ FROM [Order Details] AS [o0] LEFT JOIN ( SELECT [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[Discontinued], [s0].[ProductName], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock] FROM ( - SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[Quantity], [o1].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[Discontinued], [p0].[ProductName], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID], [o1].[ProductID], [p0].[ProductID]) AS [row] + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[Quantity], [o1].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[Discontinued], [p0].[ProductName], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID], [o1].[ProductID]) AS [row] FROM [Order Details] AS [o1] INNER JOIN [Products] AS [p0] ON [o1].[ProductID] = [p0].[ProductID] WHERE [o1].[UnitPrice] > 10.0 @@ -2150,7 +2150,7 @@ FROM [Order Details] AS [o2] WHERE [o2].[UnitPrice] < 10.0 ) AS [s2] ON [o].[OrderID] = [s2].[OrderID] WHERE [o].[OrderID] < 10350 -ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s1].[OrderID], [s1].[ProductID], [s1].[ProductID0], [s2].[OrderID], [s2].[ProductID] +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s2].[OrderID] """); } @@ -2361,7 +2361,7 @@ FROM [Orders] AS [o1] ) AS [o4] ON [c].[CustomerID] = [o4].[CustomerID] LEFT JOIN [Order Details] AS [o2] ON [o4].[OrderID] = [o2].[OrderID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [s].[OrderID], [s].[OrderID0], [s].[ProductID], [o4].[OrderID], [o2].[OrderID] +ORDER BY [c].[CustomerID], [s].[OrderID], [s].[OrderID0], [s].[ProductID], [o2].[OrderID] """); } @@ -2417,7 +2417,7 @@ OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY ) AS [o1] INNER JOIN [Products] AS [p] ON [o1].[ProductID] = [p].[ProductID] ) AS [s] -ORDER BY [o2].[OrderID], [s].[OrderID] DESC, [s].[ProductID0] +ORDER BY [o2].[OrderID], [s].[OrderID] DESC """); } @@ -2427,7 +2427,7 @@ public override async Task Take_on_correlated_collection_in_first(bool async) AssertSql( """ -SELECT [c1].[CustomerID], [s].[Title], [s].[OrderID], [s].[CustomerID] +SELECT [c1].[CustomerID], [s].[Title], [s].[OrderID] FROM ( SELECT TOP(1) [c].[CustomerID] FROM [Customers] AS [c] @@ -2438,7 +2438,7 @@ OUTER APPLY ( SELECT CASE WHEN [o0].[CustomerID] = [c0].[CustomerID] OR ([o0].[CustomerID] IS NULL AND [c0].[CustomerID] IS NULL) THEN N'A' ELSE N'B' - END AS [Title], [o0].[OrderID], [c0].[CustomerID], [o0].[OrderDate] + END AS [Title], [o0].[OrderID], [o0].[OrderDate] FROM ( SELECT TOP(1) [o].[OrderID], [o].[CustomerID], [o].[OrderDate] FROM [Orders] AS [o] @@ -2447,7 +2447,7 @@ ORDER BY [o].[OrderDate] ) AS [o0] LEFT JOIN [Customers] AS [c0] ON [o0].[CustomerID] = [c0].[CustomerID] ) AS [s] -ORDER BY [c1].[CustomerID], [s].[OrderDate], [s].[OrderID] +ORDER BY [c1].[CustomerID], [s].[OrderDate] """); } @@ -2797,7 +2797,7 @@ public override async Task List_from_result_of_single_result_3(bool async) AssertSql( """ -SELECT [c0].[CustomerID], [o2].[OrderID], [o0].[ProductID], [o0].[OrderID], [o2].[c] +SELECT [c0].[CustomerID], [o0].[ProductID], [o0].[OrderID], [o2].[c] FROM ( SELECT TOP(1) [c].[CustomerID] FROM [Customers] AS [c] @@ -2812,7 +2812,7 @@ FROM [Orders] AS [o] WHERE [o1].[row] <= 1 ) AS [o2] ON [c0].[CustomerID] = [o2].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o2].[OrderID] = [o0].[OrderID] -ORDER BY [c0].[CustomerID], [o2].[OrderID], [o0].[OrderID] +ORDER BY [c0].[CustomerID], [o0].[OrderID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSplitIncludeNoTrackingQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSplitIncludeNoTrackingQuerySqlServerTest.cs index a8a8a1193a3..8344bf4842b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSplitIncludeNoTrackingQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSplitIncludeNoTrackingQuerySqlServerTest.cs @@ -516,16 +516,15 @@ public override async Task Include_collection_and_reference(bool async) FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [o].[OrderID], [c].[CustomerID] +SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [o].[OrderID] FROM [Orders] AS [o] -LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] INNER JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -537,7 +536,7 @@ public override async Task Include_collection_with_multiple_conditional_order_by """ @p='5' -SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] +SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] ORDER BY CASE @@ -546,15 +545,15 @@ ELSE CAST(0 AS bit) END, CASE WHEN [c].[CustomerID] IS NOT NULL THEN [c].[City] ELSE N'' -END, [o].[OrderID], [c].[CustomerID] +END, [o].[OrderID] """, // """ @p='5' -SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [s].[OrderID], [s].[CustomerID] +SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [s].[OrderID] FROM ( - SELECT TOP(@p) [o].[OrderID], [c].[CustomerID], CASE + SELECT TOP(@p) [o].[OrderID], CASE WHEN [o].[OrderID] > 0 THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -569,10 +568,10 @@ ELSE CAST(0 AS bit) END, CASE WHEN [c].[CustomerID] IS NOT NULL THEN [c].[City] ELSE N'' - END, [o].[OrderID], [c].[CustomerID] + END, [o].[OrderID] ) AS [s] INNER JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID] """); } @@ -620,11 +619,11 @@ FROM [Orders] AS [o0] ) AS [o2] WHERE [o2].[row] <= 1 ) AS [o3] ON [o1].[OrderID] = [o3].[OrderID] -ORDER BY [o1].[OrderID], [o3].[OrderID] +ORDER BY [o1].[OrderID] """, // """ -SELECT [o6].[OrderID], [o6].[ProductID], [o6].[Discount], [o6].[Quantity], [o6].[UnitPrice], [o7].[OrderID], [o9].[OrderID] +SELECT [o6].[OrderID], [o6].[ProductID], [o6].[Discount], [o6].[Quantity], [o6].[UnitPrice], [o7].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -641,7 +640,7 @@ FROM [Orders] AS [o5] WHERE [o8].[row] <= 1 ) AS [o9] ON [o7].[OrderID] = [o9].[OrderID] INNER JOIN [Order Details] AS [o6] ON [o9].[OrderID] = [o6].[OrderID] -ORDER BY [o7].[OrderID], [o9].[OrderID] +ORDER BY [o7].[OrderID] """); } @@ -651,7 +650,7 @@ public override async Task Join_Include_collection_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -660,20 +659,20 @@ FROM [Order Details] AS [o] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] INNER JOIN [Orders] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 ) AS [s0] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +ORDER BY [s].[OrderID] """, // """ -SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -682,9 +681,9 @@ FROM [Order Details] AS [o] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID] FROM ( - SELECT [o10].[OrderID], [o9].[OrderID] AS [OrderID0], [o9].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o10].[OrderID] ORDER BY [o10].[OrderID]) AS [row] + SELECT [o10].[OrderID], ROW_NUMBER() OVER(PARTITION BY [o10].[OrderID] ORDER BY [o10].[OrderID]) AS [row] FROM [Order Details] AS [o9] INNER JOIN [Orders] AS [o10] ON [o9].[OrderID] = [o10].[OrderID] WHERE [o9].[OrderID] = 10248 @@ -692,7 +691,7 @@ FROM [Order Details] AS [o9] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] INNER JOIN [Order Details] AS [o11] ON [s1].[OrderID] = [o11].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +ORDER BY [s].[OrderID] """); } @@ -810,7 +809,7 @@ public override async Task SelectMany_Include_collection_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -819,20 +818,20 @@ CROSS JOIN [Orders] AS [o0] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] CROSS JOIN [Orders] AS [o2] WHERE [o1].[OrderID] = 10248 ) AS [s0] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +ORDER BY [s].[OrderID] """, // """ -SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -841,9 +840,9 @@ CROSS JOIN [Orders] AS [o0] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID] FROM ( - SELECT [o10].[OrderID], [o9].[OrderID] AS [OrderID0], [o9].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o10].[OrderID] ORDER BY [o10].[OrderID]) AS [row] + SELECT [o10].[OrderID], ROW_NUMBER() OVER(PARTITION BY [o10].[OrderID] ORDER BY [o10].[OrderID]) AS [row] FROM [Order Details] AS [o9] CROSS JOIN [Orders] AS [o10] WHERE [o9].[OrderID] = 10248 @@ -851,7 +850,7 @@ CROSS JOIN [Orders] AS [o10] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] INNER JOIN [Order Details] AS [o11] ON [s1].[OrderID] = [o11].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +ORDER BY [s].[OrderID] """); } @@ -875,7 +874,7 @@ public override async Task Include_collection_SelectMany_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -884,20 +883,20 @@ CROSS JOIN [Order Details] AS [o0] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] CROSS JOIN [Order Details] AS [o2] WHERE [o1].[OrderID] = 10248 ) AS [s0] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +ORDER BY [s].[OrderID] """, // """ -SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -906,9 +905,9 @@ CROSS JOIN [Order Details] AS [o0] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID] FROM ( - SELECT [o9].[OrderID], [o10].[OrderID] AS [OrderID0], [o10].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o9].[OrderID] ORDER BY [o9].[OrderID]) AS [row] + SELECT [o9].[OrderID], ROW_NUMBER() OVER(PARTITION BY [o9].[OrderID] ORDER BY [o9].[OrderID]) AS [row] FROM [Orders] AS [o9] CROSS JOIN [Order Details] AS [o10] WHERE [o9].[OrderID] = 10248 @@ -916,7 +915,7 @@ CROSS JOIN [Order Details] AS [o10] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] INNER JOIN [Order Details] AS [o11] ON [s1].[OrderID] = [o11].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +ORDER BY [s].[OrderID] """); } @@ -1076,11 +1075,11 @@ FROM [Orders] AS [o] WHERE [o0].[row] <= 1 ) AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [o1].[OrderID] +ORDER BY [c].[CustomerID] """, // """ -SELECT [o4].[OrderID], [o4].[ProductID], [o4].[Discount], [o4].[Quantity], [o4].[UnitPrice], [c].[CustomerID], [o6].[OrderID] +SELECT [o4].[OrderID], [o4].[ProductID], [o4].[Discount], [o4].[Quantity], [o4].[UnitPrice], [c].[CustomerID] FROM [Customers] AS [c] LEFT JOIN ( SELECT [o5].[OrderID], [o5].[CustomerID] @@ -1092,7 +1091,7 @@ FROM [Orders] AS [o3] ) AS [o6] ON [c].[CustomerID] = [o6].[CustomerID] INNER JOIN [Order Details] AS [o4] ON [o6].[OrderID] = [o4].[OrderID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [o6].[OrderID] +ORDER BY [c].[CustomerID] """); } @@ -1871,7 +1870,7 @@ public override async Task Repro9735(bool async) """ @p='2' -SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] +SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] ORDER BY CASE @@ -1880,15 +1879,15 @@ ELSE CAST(0 AS bit) END, CASE WHEN [c].[CustomerID] IS NOT NULL THEN [c].[CustomerID] ELSE N'' -END, [o].[OrderID], [c].[CustomerID] +END, [o].[OrderID] """, // """ @p='2' -SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [s].[OrderID], [s].[CustomerID] +SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [s].[OrderID] FROM ( - SELECT TOP(@p) [o].[OrderID], [c].[CustomerID], CASE + SELECT TOP(@p) [o].[OrderID], CASE WHEN [c].[CustomerID] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -1903,10 +1902,10 @@ ELSE CAST(0 AS bit) END, CASE WHEN [c].[CustomerID] IS NOT NULL THEN [c].[CustomerID] ELSE N'' - END, [o].[OrderID], [c].[CustomerID] + END, [o].[OrderID] ) AS [s] INNER JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID] """); } @@ -2693,7 +2692,7 @@ public override async Task Include_collection_Join_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -2702,20 +2701,20 @@ FROM [Orders] AS [o] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] INNER JOIN [Order Details] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 ) AS [s0] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +ORDER BY [s].[OrderID] """, // """ -SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -2724,9 +2723,9 @@ FROM [Orders] AS [o] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID] FROM ( - SELECT [o9].[OrderID], [o10].[OrderID] AS [OrderID0], [o10].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o9].[OrderID] ORDER BY [o9].[OrderID]) AS [row] + SELECT [o9].[OrderID], ROW_NUMBER() OVER(PARTITION BY [o9].[OrderID] ORDER BY [o9].[OrderID]) AS [row] FROM [Orders] AS [o9] INNER JOIN [Order Details] AS [o10] ON [o9].[OrderID] = [o10].[OrderID] WHERE [o9].[OrderID] = 10248 @@ -2734,7 +2733,7 @@ FROM [Orders] AS [o9] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] INNER JOIN [Order Details] AS [o11] ON [s1].[OrderID] = [o11].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +ORDER BY [s].[OrderID] """); } @@ -2748,16 +2747,15 @@ public override async Task Include_reference_and_collection(bool async) FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [o].[OrderID], [c].[CustomerID] +SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [o].[OrderID] FROM [Orders] AS [o] -LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] INNER JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSplitIncludeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSplitIncludeQuerySqlServerTest.cs index a136a8bb361..acfa3b0ac7a 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSplitIncludeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindSplitIncludeQuerySqlServerTest.cs @@ -217,16 +217,15 @@ public override async Task Include_reference_and_collection(bool async) FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [o].[OrderID], [c].[CustomerID] +SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [o].[OrderID] FROM [Orders] AS [o] -LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] INNER JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -240,7 +239,7 @@ public virtual void ToQueryString_for_include_reference_and_collection() SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """ @@ -305,17 +304,17 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] % 23 = 13 AND [o].[UnitPrice] < 10.0 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """, // """ -SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 AND [o].[UnitPrice] < 10.0 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -329,20 +328,20 @@ SELECT TOP(2) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [s].[OrderID], [s].[CustomerID] +SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [s].[OrderID] FROM ( SELECT TOP(1) [o].[OrderID], [c].[CustomerID] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] = 10248 - ORDER BY [o].[OrderID], [c].[CustomerID] + ORDER BY [o].[OrderID] ) AS [s] INNER JOIN [Orders] AS [o0] ON [s].[CustomerID] = [o0].[CustomerID] -ORDER BY [s].[OrderID], [s].[CustomerID] +ORDER BY [s].[OrderID] """); } @@ -1543,7 +1542,7 @@ public override async Task Include_collection_with_multiple_conditional_order_by """ @p='5' -SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] +SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] ORDER BY CASE @@ -1552,15 +1551,15 @@ ELSE CAST(0 AS bit) END, CASE WHEN [c].[CustomerID] IS NOT NULL THEN [c].[City] ELSE N'' -END, [o].[OrderID], [c].[CustomerID] +END, [o].[OrderID] """, // """ @p='5' -SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [s].[OrderID], [s].[CustomerID] +SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [s].[OrderID] FROM ( - SELECT TOP(@p) [o].[OrderID], [c].[CustomerID], CASE + SELECT TOP(@p) [o].[OrderID], CASE WHEN [o].[OrderID] > 0 THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -1575,10 +1574,10 @@ ELSE CAST(0 AS bit) END, CASE WHEN [c].[CustomerID] IS NOT NULL THEN [c].[City] ELSE N'' - END, [o].[OrderID], [c].[CustomerID] + END, [o].[OrderID] ) AS [s] INNER JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID] """); } @@ -1689,11 +1688,11 @@ FROM [Orders] AS [o0] ) AS [o2] WHERE [o2].[row] <= 1 ) AS [o3] ON [o1].[OrderID] = [o3].[OrderID] -ORDER BY [o1].[OrderID], [o3].[OrderID] +ORDER BY [o1].[OrderID] """, // """ -SELECT [o6].[OrderID], [o6].[ProductID], [o6].[Discount], [o6].[Quantity], [o6].[UnitPrice], [o7].[OrderID], [o9].[OrderID] +SELECT [o6].[OrderID], [o6].[ProductID], [o6].[Discount], [o6].[Quantity], [o6].[UnitPrice], [o7].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1710,7 +1709,7 @@ FROM [Orders] AS [o5] WHERE [o8].[row] <= 1 ) AS [o9] ON [o7].[OrderID] = [o9].[OrderID] INNER JOIN [Order Details] AS [o6] ON [o9].[OrderID] = [o6].[OrderID] -ORDER BY [o7].[OrderID], [o9].[OrderID] +ORDER BY [o7].[OrderID] """); } @@ -1746,7 +1745,7 @@ public override async Task Include_collection_Join_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1755,20 +1754,20 @@ FROM [Orders] AS [o] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] INNER JOIN [Order Details] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 ) AS [s0] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +ORDER BY [s].[OrderID] """, // """ -SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1777,9 +1776,9 @@ FROM [Orders] AS [o] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID] FROM ( - SELECT [o9].[OrderID], [o10].[OrderID] AS [OrderID0], [o10].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o9].[OrderID] ORDER BY [o9].[OrderID]) AS [row] + SELECT [o9].[OrderID], ROW_NUMBER() OVER(PARTITION BY [o9].[OrderID] ORDER BY [o9].[OrderID]) AS [row] FROM [Orders] AS [o9] INNER JOIN [Order Details] AS [o10] ON [o9].[OrderID] = [o10].[OrderID] WHERE [o9].[OrderID] = 10248 @@ -1787,7 +1786,7 @@ FROM [Orders] AS [o9] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] INNER JOIN [Order Details] AS [o11] ON [s1].[OrderID] = [o11].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +ORDER BY [s].[OrderID] """); } @@ -1825,7 +1824,7 @@ public override async Task Join_Include_collection_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1834,20 +1833,20 @@ FROM [Order Details] AS [o] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] INNER JOIN [Orders] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 ) AS [s0] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +ORDER BY [s].[OrderID] """, // """ -SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1856,9 +1855,9 @@ FROM [Order Details] AS [o] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID] FROM ( - SELECT [o10].[OrderID], [o9].[OrderID] AS [OrderID0], [o9].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o10].[OrderID] ORDER BY [o10].[OrderID]) AS [row] + SELECT [o10].[OrderID], ROW_NUMBER() OVER(PARTITION BY [o10].[OrderID] ORDER BY [o10].[OrderID]) AS [row] FROM [Order Details] AS [o9] INNER JOIN [Orders] AS [o10] ON [o9].[OrderID] = [o10].[OrderID] WHERE [o9].[OrderID] = 10248 @@ -1866,7 +1865,7 @@ FROM [Order Details] AS [o9] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] INNER JOIN [Order Details] AS [o11] ON [s1].[OrderID] = [o11].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +ORDER BY [s].[OrderID] """); } @@ -1902,7 +1901,7 @@ public override async Task Include_collection_SelectMany_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1911,20 +1910,20 @@ CROSS JOIN [Order Details] AS [o0] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] CROSS JOIN [Order Details] AS [o2] WHERE [o1].[OrderID] = 10248 ) AS [s0] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +ORDER BY [s].[OrderID] """, // """ -SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1933,9 +1932,9 @@ CROSS JOIN [Order Details] AS [o0] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID] FROM ( - SELECT [o9].[OrderID], [o10].[OrderID] AS [OrderID0], [o10].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o9].[OrderID] ORDER BY [o9].[OrderID]) AS [row] + SELECT [o9].[OrderID], ROW_NUMBER() OVER(PARTITION BY [o9].[OrderID] ORDER BY [o9].[OrderID]) AS [row] FROM [Orders] AS [o9] CROSS JOIN [Order Details] AS [o10] WHERE [o9].[OrderID] = 10248 @@ -1943,7 +1942,7 @@ CROSS JOIN [Order Details] AS [o10] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] INNER JOIN [Order Details] AS [o11] ON [s1].[OrderID] = [o11].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID] +ORDER BY [s].[OrderID] """); } @@ -1981,7 +1980,7 @@ public override async Task SelectMany_Include_collection_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1990,20 +1989,20 @@ CROSS JOIN [Orders] AS [o0] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] CROSS JOIN [Orders] AS [o2] WHERE [o1].[OrderID] = 10248 ) AS [s0] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +ORDER BY [s].[OrderID] """, // """ -SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +SELECT [o11].[OrderID], [o11].[ProductID], [o11].[Discount], [o11].[Quantity], [o11].[UnitPrice], [s].[OrderID] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -2012,9 +2011,9 @@ CROSS JOIN [Orders] AS [o0] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID] FROM ( - SELECT [o10].[OrderID], [o9].[OrderID] AS [OrderID0], [o9].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o10].[OrderID] ORDER BY [o10].[OrderID]) AS [row] + SELECT [o10].[OrderID], ROW_NUMBER() OVER(PARTITION BY [o10].[OrderID] ORDER BY [o10].[OrderID]) AS [row] FROM [Order Details] AS [o9] CROSS JOIN [Orders] AS [o10] WHERE [o9].[OrderID] = 10248 @@ -2022,7 +2021,7 @@ CROSS JOIN [Orders] AS [o10] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] INNER JOIN [Order Details] AS [o11] ON [s1].[OrderID] = [o11].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID] +ORDER BY [s].[OrderID] """); } @@ -2510,11 +2509,11 @@ FROM [Orders] AS [o] WHERE [o0].[row] <= 1 ) AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [o1].[OrderID] +ORDER BY [c].[CustomerID] """, // """ -SELECT [o4].[OrderID], [o4].[ProductID], [o4].[Discount], [o4].[Quantity], [o4].[UnitPrice], [c].[CustomerID], [o6].[OrderID] +SELECT [o4].[OrderID], [o4].[ProductID], [o4].[Discount], [o4].[Quantity], [o4].[UnitPrice], [c].[CustomerID] FROM [Customers] AS [c] LEFT JOIN ( SELECT [o5].[OrderID], [o5].[CustomerID] @@ -2526,7 +2525,7 @@ FROM [Orders] AS [o3] ) AS [o6] ON [c].[CustomerID] = [o6].[CustomerID] INNER JOIN [Order Details] AS [o4] ON [o6].[OrderID] = [o4].[OrderID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [o6].[OrderID] +ORDER BY [c].[CustomerID] """); } @@ -2542,18 +2541,18 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """, // """ -SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID] FROM [Order Details] AS [o] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2588,16 +2587,16 @@ public override async Task Include_with_cycle_does_not_throw_when_AsNoTrackingWi FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [o].[OrderID], [c].[CustomerID] +SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [o].[OrderID] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2679,18 +2678,18 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """, // """ -SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] INNER JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2732,17 +2731,17 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """, // """ -SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2757,17 +2756,17 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """, // """ -SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2809,16 +2808,16 @@ public override async Task Include_reference_and_collection_order_by(bool async) FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [o].[OrderID], [c].[CustomerID] +SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [o].[OrderID] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2834,18 +2833,18 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """, // """ -SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID] FROM [Order Details] AS [o] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2860,17 +2859,17 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] WHERE [o].[ProductID] % 23 = 17 AND [o].[Quantity] < CAST(10 AS smallint) -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """, // """ -SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[ProductID] % 23 = 17 AND [o].[Quantity] < CAST(10 AS smallint) -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2884,16 +2883,15 @@ public override async Task Include_collection_and_reference(bool async) FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [o].[OrderID], [c].[CustomerID] +SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [o].[OrderID] FROM [Orders] AS [o] -LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] INNER JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2959,16 +2957,16 @@ public override async Task Include_with_cycle_does_not_throw_when_AsTracking_NoT FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [o].[OrderID], [c].[CustomerID] +SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [o].[OrderID] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2982,16 +2980,16 @@ public override async Task Include_references_then_include_collection(bool async FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [o].[OrderID], [c].[CustomerID] +SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [o].[OrderID] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] INNER JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -3035,18 +3033,18 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """, // """ -SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o].[OrderID], [o].[ProductID] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] INNER JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -3058,7 +3056,7 @@ public override async Task Repro9735(bool async) """ @p='2' -SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] +SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] ORDER BY CASE @@ -3067,15 +3065,15 @@ ELSE CAST(0 AS bit) END, CASE WHEN [c].[CustomerID] IS NOT NULL THEN [c].[CustomerID] ELSE N'' -END, [o].[OrderID], [c].[CustomerID] +END, [o].[OrderID] """, // """ @p='2' -SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [s].[OrderID], [s].[CustomerID] +SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [s].[OrderID] FROM ( - SELECT TOP(@p) [o].[OrderID], [c].[CustomerID], CASE + SELECT TOP(@p) [o].[OrderID], CASE WHEN [c].[CustomerID] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -3090,10 +3088,10 @@ ELSE CAST(0 AS bit) END, CASE WHEN [c].[CustomerID] IS NOT NULL THEN [c].[CustomerID] ELSE N'' - END, [o].[OrderID], [c].[CustomerID] + END, [o].[OrderID] ) AS [s] INNER JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID] """); } @@ -3120,20 +3118,20 @@ SELECT TOP(2) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """, // """ -SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [s].[OrderID], [s].[CustomerID] +SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [s].[OrderID] FROM ( SELECT TOP(1) [o].[OrderID], [c].[CustomerID] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] WHERE [o].[OrderID] = 10248 - ORDER BY [o].[OrderID], [c].[CustomerID] + ORDER BY [o].[OrderID] ) AS [s] INNER JOIN [Orders] AS [o0] ON [s].[CustomerID] = [o0].[CustomerID] -ORDER BY [s].[OrderID], [s].[CustomerID] +ORDER BY [s].[OrderID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindStringIncludeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindStringIncludeQuerySqlServerTest.cs index 708cdb24de9..3990360f3a4 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindStringIncludeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindStringIncludeQuerySqlServerTest.cs @@ -67,7 +67,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -219,7 +219,7 @@ FROM [Orders] AS [o] WHERE [o].[OrderID] = 10248 ) AS [s] LEFT JOIN [Orders] AS [o0] ON [s].[CustomerID0] = [o0].[CustomerID] -ORDER BY [s].[OrderID], [s].[CustomerID0] +ORDER BY [s].[OrderID] """); } @@ -234,7 +234,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -414,9 +414,9 @@ public override async Task Repro9735(bool async) """ @p='2' -SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [s].[CustomerID0], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] +SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] FROM ( - SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] AS [CustomerID0], CASE + SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], CASE WHEN [c].[CustomerID] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -434,7 +434,7 @@ ELSE N'' END ) AS [s] LEFT JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID0], [o0].[OrderID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID], [o0].[OrderID] """); } @@ -563,7 +563,7 @@ FROM [Order Details] AS [o0] ) AS [s] ON [o].[OrderID] = [s].[OrderID] ) AS [s0] ON [c].[CustomerID] = [s0].[CustomerID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [s0].[OrderID], [s0].[OrderID0], [s0].[ProductID] +ORDER BY [c].[CustomerID], [s0].[OrderID], [s0].[OrderID0] """); } @@ -798,7 +798,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -816,7 +816,7 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] ) AS [s] ON [p].[ProductID] = [s].[ProductID] WHERE [p].[ProductID] % 17 = 5 -ORDER BY [p].[ProductID], [s].[OrderID], [s].[ProductID] +ORDER BY [p].[ProductID], [s].[OrderID] """); } @@ -932,7 +932,7 @@ LEFT JOIN ( FROM [Order Details] AS [o0] INNER JOIN [Products] AS [p] ON [o0].[ProductID] = [p].[ProductID] ) AS [s] ON [o1].[OrderID] = [s].[OrderID] -ORDER BY [o1].[OrderID], [s].[OrderID], [s].[ProductID] +ORDER BY [o1].[OrderID], [s].[OrderID] """); } @@ -998,7 +998,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 AND [o].[UnitPrice] < 10.0 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1054,7 +1054,7 @@ FROM [Orders] AS [o] ) AS [o2] ON [c].[CustomerID] = [o2].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o2].[OrderID] = [o0].[OrderID] WHERE [c].[CustomerID] LIKE N'F%' -ORDER BY [c].[CustomerID], [o2].[OrderID], [o0].[OrderID] +ORDER BY [c].[CustomerID], [o0].[OrderID] """); } @@ -1098,9 +1098,9 @@ public override async Task Include_collection_with_multiple_conditional_order_by """ @p='5' -SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [s].[CustomerID0], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] +SELECT [s].[OrderID], [s].[CustomerID], [s].[EmployeeID], [s].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice] FROM ( - SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID] AS [CustomerID0], CASE + SELECT TOP(@p) [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], CASE WHEN [o].[OrderID] > 0 THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [c], CASE @@ -1118,7 +1118,7 @@ ELSE N'' END ) AS [s] LEFT JOIN [Order Details] AS [o0] ON [s].[OrderID] = [o0].[OrderID] -ORDER BY [s].[c], [s].[c0], [s].[OrderID], [s].[CustomerID0], [o0].[OrderID] +ORDER BY [s].[c], [s].[c0], [s].[OrderID], [o0].[OrderID] """); } @@ -1172,7 +1172,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[OrderID] < 10800 -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -1188,7 +1188,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[ProductID] % 23 = 17 AND [o].[Quantity] < CAST(10 AS smallint) -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1265,14 +1265,14 @@ public override async Task Include_multiple_references_then_include_collection_m AssertSql( """ -SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [p].[ProductID], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] +SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[ProductID], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1325,7 +1325,7 @@ public override async Task Include_collection_SelectMany_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1334,9 +1334,9 @@ CROSS JOIN [Order Details] AS [o0] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] CROSS JOIN [Order Details] AS [o2] WHERE [o1].[OrderID] = 10248 @@ -1344,7 +1344,7 @@ CROSS JOIN [Order Details] AS [o2] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1526,7 +1526,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [p].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1577,7 +1577,7 @@ public override async Task Include_collection_Join_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o].[OrderID] FROM [Orders] AS [o] @@ -1586,9 +1586,9 @@ FROM [Orders] AS [o] GROUP BY [o].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [o2].[OrderID] AS [OrderID0], [o2].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] + SELECT [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o1].[OrderID] ORDER BY [o1].[OrderID]) AS [row] FROM [Orders] AS [o1] INNER JOIN [Order Details] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 @@ -1596,7 +1596,7 @@ FROM [Orders] AS [o1] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1623,7 +1623,7 @@ FROM [Orders] AS [o0] WHERE [o3].[row] <= 1 ) AS [o4] ON [o2].[OrderID] = [o4].[OrderID] LEFT JOIN [Order Details] AS [o1] ON [o4].[OrderID] = [o1].[OrderID] -ORDER BY [o2].[OrderID], [o4].[OrderID], [o1].[OrderID] +ORDER BY [o2].[OrderID], [o1].[OrderID] """); } @@ -1652,7 +1652,7 @@ public override async Task Join_Include_collection_GroupBy_Select(bool async) AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1661,9 +1661,9 @@ FROM [Order Details] AS [o] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] INNER JOIN [Orders] AS [o2] ON [o1].[OrderID] = [o2].[OrderID] WHERE [o1].[OrderID] = 10248 @@ -1671,7 +1671,7 @@ FROM [Order Details] AS [o1] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1735,12 +1735,12 @@ public override async Task Include_collection_and_reference(bool async) AssertSql( """ -SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region] FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """); } @@ -1771,7 +1771,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -1781,7 +1781,7 @@ public override async Task SelectMany_Include_collection_GroupBy_Select(bool asy AssertSql( """ -SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] +SELECT [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[OrderDate], [s].[OrderID], [o3].[OrderID], [o3].[ProductID], [o3].[Discount], [o3].[Quantity], [o3].[UnitPrice] FROM ( SELECT [o0].[OrderID] FROM [Order Details] AS [o] @@ -1790,9 +1790,9 @@ CROSS JOIN [Orders] AS [o0] GROUP BY [o0].[OrderID] ) AS [s] LEFT JOIN ( - SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate], [s0].[OrderID0], [s0].[ProductID] + SELECT [s0].[OrderID], [s0].[CustomerID], [s0].[EmployeeID], [s0].[OrderDate] FROM ( - SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], [o1].[OrderID] AS [OrderID0], [o1].[ProductID], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] + SELECT [o2].[OrderID], [o2].[CustomerID], [o2].[EmployeeID], [o2].[OrderDate], ROW_NUMBER() OVER(PARTITION BY [o2].[OrderID] ORDER BY [o2].[OrderID]) AS [row] FROM [Order Details] AS [o1] CROSS JOIN [Orders] AS [o2] WHERE [o1].[OrderID] = 10248 @@ -1800,7 +1800,7 @@ CROSS JOIN [Orders] AS [o2] WHERE [s0].[row] <= 1 ) AS [s1] ON [s].[OrderID] = [s1].[OrderID] LEFT JOIN [Order Details] AS [o3] ON [s1].[OrderID] = [o3].[OrderID] -ORDER BY [s].[OrderID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [o3].[OrderID] +ORDER BY [s].[OrderID], [o3].[OrderID] """); } @@ -1868,7 +1868,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID] +ORDER BY [o].[OrderID], [o0].[OrderID] """); } @@ -1939,7 +1939,7 @@ FROM [Orders] AS [o] LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o0] ON [c].[CustomerID] = [o0].[CustomerID] WHERE [o].[CustomerID] LIKE N'F%' -ORDER BY [o].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID] """); } @@ -2022,7 +2022,7 @@ FROM [Orders] AS [o] WHERE [o].[OrderID] = 10248 ) AS [s] LEFT JOIN [Orders] AS [o0] ON [s].[CustomerID0] = [o0].[CustomerID] -ORDER BY [s].[OrderID], [s].[CustomerID0] +ORDER BY [s].[OrderID] """); } @@ -2032,14 +2032,14 @@ public override async Task Include_multiple_references_and_collection_multi_leve AssertSql( """ -SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [p].[ProductID], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] +SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[Quantity], [o].[UnitPrice], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[OrderDate], [p].[ProductID], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] INNER JOIN [Products] AS [p] ON [o].[ProductID] = [p].[ProductID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] % 23 = 13 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID], [p].[ProductID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } @@ -2112,7 +2112,7 @@ FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] ) AS [s] ON [p].[ProductID] = [s].[ProductID] WHERE [p].[ProductID] % 17 = 5 AND [p].[UnitPrice] < 20.0 -ORDER BY [p].[ProductID], [s].[OrderID], [s].[ProductID] +ORDER BY [p].[ProductID], [s].[OrderID] """); } @@ -2141,7 +2141,7 @@ FROM [Order Details] AS [o] LEFT JOIN [Customers] AS [c] ON [o0].[CustomerID] = [c].[CustomerID] LEFT JOIN [Orders] AS [o1] ON [c].[CustomerID] = [o1].[CustomerID] WHERE [o].[OrderID] = 10248 -ORDER BY [o].[OrderID], [o].[ProductID], [o0].[OrderID], [c].[CustomerID] +ORDER BY [o].[OrderID], [o].[ProductID] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/OwnedEntityQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/OwnedEntityQuerySqlServerTest.cs index 46955dd7e06..2a5485b8d93 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/OwnedEntityQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/OwnedEntityQuerySqlServerTest.cs @@ -493,7 +493,7 @@ LEFT JOIN ( FROM [JoinEntity] AS [j] INNER JOIN [OtherSide] AS [o] ON [j].[OtherSideId] = [o].[Id] ) AS [s] ON [p].[Id] = [s].[ParentId] -ORDER BY [p].[Id], [r].[Id], [c].[Id], [s].[ParentId], [s].[OtherSideId] +ORDER BY [p].[Id], [r].[Id], [c].[Id], [s].[ParentId] """, // """ diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/OwnedQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/OwnedQuerySqlServerTest.cs index 758f0e05409..ceb610b0a44 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/OwnedQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/OwnedQuerySqlServerTest.cs @@ -340,7 +340,7 @@ public override async Task Filter_owned_entity_chained_with_regular_entity_follo AssertSql( """ -SELECT [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail] +SELECT [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail] FROM [OwnedPerson] AS [o] LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN ( @@ -349,7 +349,7 @@ FROM [Order] AS [o0] LEFT JOIN [OrderDetail] AS [o1] ON [o0].[ClientId] = [o1].[OrderClientId] AND [o0].[Id] = [o1].[OrderId] ) AS [s] ON [o].[Id] = [s].[ClientId] WHERE [p].[Id] <> 42 OR [p].[Id] IS NULL -ORDER BY [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] +ORDER BY [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] """); } @@ -359,7 +359,7 @@ public override async Task Project_multiple_owned_navigations(bool async) AssertSql( """ -SELECT [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [o].[PersonAddress_AddressLine], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [p].[Name], [p].[StarId] +SELECT [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [o].[PersonAddress_AddressLine], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [p].[Id], [p].[Name], [p].[StarId] FROM [OwnedPerson] AS [o] LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN ( @@ -367,7 +367,7 @@ LEFT JOIN ( FROM [Order] AS [o0] LEFT JOIN [OrderDetail] AS [o1] ON [o0].[ClientId] = [o1].[OrderClientId] AND [o0].[Id] = [o1].[OrderId] ) AS [s] ON [o].[Id] = [s].[ClientId] -ORDER BY [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] +ORDER BY [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] """); } @@ -396,7 +396,7 @@ public override async Task Navigation_rewrite_on_owned_reference_followed_by_reg AssertSql( """ -SELECT [o].[Id], [o].[Discriminator], [o].[Name], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [o].[PersonAddress_AddressLine], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [o].[BranchAddress_BranchName], [o].[BranchAddress_PlaceType], [o].[BranchAddress_Country_Name], [o].[BranchAddress_Country_PlanetId], [o].[LeafBAddress_LeafBType], [o].[LeafBAddress_PlaceType], [o].[LeafBAddress_Country_Name], [o].[LeafBAddress_Country_PlanetId], [o].[LeafAAddress_LeafType], [o].[LeafAAddress_PlaceType], [o].[LeafAAddress_Country_Name], [o].[LeafAAddress_Country_PlanetId] +SELECT [o].[Id], [o].[Discriminator], [o].[Name], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [o].[PersonAddress_AddressLine], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [o].[BranchAddress_BranchName], [o].[BranchAddress_PlaceType], [o].[BranchAddress_Country_Name], [o].[BranchAddress_Country_PlanetId], [o].[LeafBAddress_LeafBType], [o].[LeafBAddress_PlaceType], [o].[LeafBAddress_Country_Name], [o].[LeafBAddress_Country_PlanetId], [o].[LeafAAddress_LeafType], [o].[LeafAAddress_PlaceType], [o].[LeafAAddress_Country_Name], [o].[LeafAAddress_Country_PlanetId] FROM [OwnedPerson] AS [o] LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN ( @@ -405,7 +405,7 @@ FROM [Order] AS [o0] LEFT JOIN [OrderDetail] AS [o1] ON [o0].[ClientId] = [o1].[OrderClientId] AND [o0].[Id] = [o1].[OrderId] ) AS [s] ON [o].[Id] = [s].[ClientId] WHERE [p].[Id] <> 7 OR [p].[Id] IS NULL -ORDER BY [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] +ORDER BY [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] """); } @@ -427,11 +427,11 @@ public override async Task Navigation_rewrite_on_owned_reference_followed_by_reg AssertSql( """ -SELECT [o].[Id], [p].[Id], [m].[Id], [m].[Diameter], [m].[PlanetId] +SELECT [o].[Id], [m].[Id], [m].[Diameter], [m].[PlanetId] FROM [OwnedPerson] AS [o] LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN [Moon] AS [m] ON [p].[Id] = [m].[PlanetId] -ORDER BY [o].[Id], [p].[Id] +ORDER BY [o].[Id] """); } @@ -468,12 +468,12 @@ public override async Task Navigation_rewrite_on_owned_reference_followed_by_reg AssertSql( """ -SELECT [s].[Id], [s].[Name], [o].[Id], [p].[Id], [e].[Id], [e].[Name], [e].[StarId] +SELECT [s].[Id], [s].[Name], [o].[Id], [e].[Id], [e].[Name], [e].[StarId] FROM [OwnedPerson] AS [o] LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN [Star] AS [s] ON [p].[StarId] = [s].[Id] LEFT JOIN [Element] AS [e] ON [s].[Id] = [e].[StarId] -ORDER BY [o].[Id], [p].[Id], [s].[Id] +ORDER BY [o].[Id] """); } @@ -499,13 +499,13 @@ await base.Navigation_rewrite_on_owned_reference_followed_by_regular_entity_and_ AssertSql( """ -SELECT [s].[Id], [s].[Name], [o].[Id], [p].[Id], [e].[Id], [e].[Name], [e].[StarId] +SELECT [s].[Id], [s].[Name], [o].[Id], [e].[Id], [e].[Name], [e].[StarId] FROM [OwnedPerson] AS [o] LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN [Star] AS [s] ON [p].[StarId] = [s].[Id] LEFT JOIN [Element] AS [e] ON [s].[Id] = [e].[StarId] WHERE [s].[Name] = N'Sol' -ORDER BY [o].[Id], [p].[Id], [s].[Id] +ORDER BY [o].[Id] """); } @@ -1170,27 +1170,25 @@ public override async Task Project_multiple_owned_navigations_split(bool async) AssertSql( """ -SELECT [o].[Id], [p].[Id], [o].[PersonAddress_AddressLine], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [p].[Name], [p].[StarId] +SELECT [o].[Id], [o].[PersonAddress_AddressLine], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [p].[Id], [p].[Name], [p].[StarId] FROM [OwnedPerson] AS [o] LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] -ORDER BY [o].[Id], [p].[Id] +ORDER BY [o].[Id] """, // """ -SELECT [o1].[ClientId], [o1].[Id], [o1].[OrderDate], [o].[Id], [p].[Id] +SELECT [o1].[ClientId], [o1].[Id], [o1].[OrderDate], [o].[Id] FROM [OwnedPerson] AS [o] -LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] INNER JOIN [Order] AS [o1] ON [o].[Id] = [o1].[ClientId] -ORDER BY [o].[Id], [p].[Id], [o1].[ClientId], [o1].[Id] +ORDER BY [o].[Id], [o1].[ClientId], [o1].[Id] """, // """ -SELECT [o3].[OrderClientId], [o3].[OrderId], [o3].[Id], [o3].[Detail], [o].[Id], [p].[Id], [o1].[ClientId], [o1].[Id] +SELECT [o3].[OrderClientId], [o3].[OrderId], [o3].[Id], [o3].[Detail], [o].[Id], [o1].[ClientId], [o1].[Id] FROM [OwnedPerson] AS [o] -LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] INNER JOIN [Order] AS [o1] ON [o].[Id] = [o1].[ClientId] INNER JOIN [OrderDetail] AS [o3] ON [o1].[ClientId] = [o3].[OrderClientId] AND [o1].[Id] = [o3].[OrderId] -ORDER BY [o].[Id], [p].[Id], [o1].[ClientId], [o1].[Id] +ORDER BY [o].[Id], [o1].[ClientId], [o1].[Id] """); } @@ -1200,18 +1198,17 @@ public override async Task Navigation_rewrite_on_owned_reference_followed_by_reg AssertSql( """ -SELECT [o].[Id], [p].[Id] +SELECT [o].[Id] FROM [OwnedPerson] AS [o] -LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] -ORDER BY [o].[Id], [p].[Id] +ORDER BY [o].[Id] """, // """ -SELECT [m].[Id], [m].[Diameter], [m].[PlanetId], [o].[Id], [p].[Id] +SELECT [m].[Id], [m].[Diameter], [m].[PlanetId], [o].[Id] FROM [OwnedPerson] AS [o] LEFT JOIN [Planet] AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] INNER JOIN [Moon] AS [m] ON [p].[Id] = [m].[PlanetId] -ORDER BY [o].[Id], [p].[Id] +ORDER BY [o].[Id] """); } @@ -1391,11 +1388,11 @@ public override async Task Projecting_collection_correlated_with_keyless_entity_ AssertSql( """ -SELECT [b].[Throned_Value], [f].[Id], [b].[Id], [p].[Id], [p].[Name], [p].[StarId] +SELECT [b].[Throned_Value], [f].[Id], [p].[Id], [p].[Name], [p].[StarId] FROM [Fink] AS [f] LEFT JOIN [Barton] AS [b] ON [f].[BartonId] = [b].[Id] LEFT JOIN [Planet] AS [p] ON [b].[Throned_Value] <> [p].[Id] OR [b].[Throned_Value] IS NULL -ORDER BY [f].[Id], [b].[Id] +ORDER BY [f].[Id] """); } @@ -1467,7 +1464,7 @@ LEFT JOIN ( FROM [Order] AS [o2] LEFT JOIN [OrderDetail] AS [o3] ON [o2].[ClientId] = [o3].[OrderClientId] AND [o2].[Id] = [o3].[OrderId] ) AS [s0] ON [o].[Id] = [s0].[ClientId] -ORDER BY [p].[Id], [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s0].[ClientId], [s0].[Id], [s0].[OrderClientId], [s0].[OrderId] +ORDER BY [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s0].[ClientId], [s0].[Id], [s0].[OrderClientId], [s0].[OrderId] """); } @@ -1489,7 +1486,7 @@ LEFT JOIN ( FROM [Order] AS [o0] LEFT JOIN [OrderDetail] AS [o1] ON [o0].[ClientId] = [o1].[OrderClientId] AND [o0].[Id] = [o1].[OrderId] ) AS [s0] ON [s].[Id0] = [s0].[ClientId] -ORDER BY [p].[Id], [s].[Id], [s].[Id0], [s0].[ClientId], [s0].[Id], [s0].[OrderClientId], [s0].[OrderId] +ORDER BY [p].[Id], [s].[Id], [s0].[ClientId], [s0].[Id], [s0].[OrderClientId], [s0].[OrderId] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsQuerySqlServerTest.cs index bd7663a5818..c3a6b2c2602 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsQuerySqlServerTest.cs @@ -278,7 +278,7 @@ public override async Task Complex_query_with_let_collection_projection_FirstOrD AssertSql( """ -SELECT [l].[Id], [l4].[Id], [l5].[Name], [l5].[Id], [l4].[c] +SELECT [l].[Id], [l5].[Name], [l5].[Id], [l4].[c] FROM [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN ( SELECT [l3].[c], [l3].[Id], [l3].[OneToMany_Optional_Inverse2Id] @@ -297,7 +297,7 @@ SELECT 1 FROM [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l2] WHERE [l1].[Id] = [l2].[OneToMany_Optional_Inverse2Id] AND [l2].[Id] = [l4].[Id]) ) AS [l5] -ORDER BY [l].[Id], [l4].[Id] +ORDER BY [l].[Id] """); } @@ -449,7 +449,7 @@ LEFT JOIN ( WHERE [l3].[row] <= 1 ) AS [l4] ON [l2].[Name] = [l4].[Name] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [l4].[Id] = [l1].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -459,10 +459,10 @@ public override async Task Select_subquery_single_nested_subquery2(bool async) AssertSql( """ -SELECT [l].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[c] +SELECT [l].[Id], [s].[Id], [s].[Id0], [s].[c] FROM [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN ( - SELECT [l0].[Id], [l4].[Id] AS [Id0], [l2].[Id] AS [Id1], [l4].[c], [l0].[OneToMany_Optional_Inverse2Id] + SELECT [l0].[Id], [l2].[Id] AS [Id0], [l4].[c], [l0].[OneToMany_Optional_Inverse2Id] FROM [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l0] LEFT JOIN ( SELECT [l3].[c], [l3].[Id], [l3].[OneToMany_Optional_Inverse3Id] @@ -474,7 +474,7 @@ LEFT JOIN ( ) AS [l4] ON [l0].[Id] = [l4].[OneToMany_Optional_Inverse3Id] LEFT JOIN [LevelFour] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l2] ON [l4].[Id] = [l2].[OneToMany_Optional_Inverse4Id] ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Inverse2Id] -ORDER BY [l].[Id], [s].[Id], [s].[Id0], [s].[Id1] +ORDER BY [l].[Id], [s].[Id], [s].[Id0] """); } @@ -776,7 +776,7 @@ WHERE [l0].[Id] > 3 WHERE [l3].[row] <= 1 ) AS [l4] ON [l2].[Name] = [l4].[Name] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [l4].[Id] = [l1].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -922,20 +922,20 @@ public override async Task SelectMany_DefaultIfEmpty_multiple_times_with_joins_p AssertSql( """ -SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l2].[PeriodEnd], [l2].[PeriodStart], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l12].[Id], [l13].[Id], [l14].[Id], [l16].[Id], [l16].[Date], [l16].[Level1_Optional_Id], [l16].[Level1_Required_Id], [l16].[Name], [l16].[OneToMany_Optional_Inverse2Id], [l16].[OneToMany_Optional_Self_Inverse2Id], [l16].[OneToMany_Required_Inverse2Id], [l16].[OneToMany_Required_Self_Inverse2Id], [l16].[OneToOne_Optional_PK_Inverse2Id], [l16].[OneToOne_Optional_Self2Id], [l16].[PeriodEnd], [l16].[PeriodStart], [l14].[Name] +SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l2].[PeriodEnd], [l2].[PeriodStart], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l12].[Id], [l14].[Id], [l16].[Id], [l16].[Date], [l16].[Level1_Optional_Id], [l16].[Level1_Required_Id], [l16].[Name], [l16].[OneToMany_Optional_Inverse2Id], [l16].[OneToMany_Optional_Self_Inverse2Id], [l16].[OneToMany_Required_Inverse2Id], [l16].[OneToMany_Required_Self_Inverse2Id], [l16].[OneToOne_Optional_PK_Inverse2Id], [l16].[OneToOne_Optional_Self2Id], [l16].[PeriodEnd], [l16].[PeriodStart], [l14].[Name] FROM [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l0] ON [l].[Id] = [l0].[Level1_Required_Id] LEFT JOIN [LevelThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [l0].[Id] = [l1].[Level2_Optional_Id] LEFT JOIN [LevelFour] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l2] ON [l1].[Id] = [l2].[OneToMany_Required_Inverse4Id] INNER JOIN ( - SELECT [l3].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l6].[Id] AS [Id2] + SELECT [l3].[Id], [l6].[Id] AS [Id2] FROM [LevelFour] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l3] INNER JOIN [LevelThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l4] ON [l3].[Level3_Required_Id] = [l4].[Id] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l5] ON [l4].[Level2_Optional_Id] = [l5].[Id] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l6] ON [l5].[Id] = [l6].[OneToMany_Required_Self_Inverse2Id] ) AS [s] ON [l2].[Id] = [s].[Id2] LEFT JOIN ( - SELECT [l7].[Id], [l8].[Id] AS [Id0], [l9].[Id] AS [Id1], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] + SELECT [l7].[Id], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] FROM [LevelFour] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l7] INNER JOIN [LevelThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l8] ON [l7].[Level3_Required_Id] = [l8].[Id] INNER JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l9] ON [l8].[Level2_Required_Id] = [l9].[Id] @@ -951,7 +951,7 @@ LEFT JOIN ( WHERE [l15].[Id] <> 42 ) AS [l16] ON [s].[Id2] = [l16].[OneToMany_Optional_Self_Inverse2Id] WHERE [l11].[Name] <> N'Foo' OR [l11].[Name] IS NULL -ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l13].[Id], [l14].[Id] +ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l14].[Id] """); } @@ -1120,7 +1120,7 @@ LEFT JOIN ( WHERE [l3].[row] <= 1 ) AS [l4] ON [l2].[Name] = [l4].[Name] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [l4].[Id] = [l1].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -1211,7 +1211,7 @@ public override async Task Complex_query_with_let_collection_projection_FirstOrD AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l4].[Name], [l4].[Id], [l3].[c] +SELECT [l].[Id], [l4].[Name], [l4].[Id], [l3].[c] FROM [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] OUTER APPLY ( SELECT TOP(1) 1 AS [c], [l0].[Id] @@ -1226,7 +1226,7 @@ SELECT 1 FROM [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l2] WHERE [l1].[Id] = [l2].[OneToMany_Optional_Inverse2Id] AND [l2].[Id] = [l3].[Id]) ) AS [l4] -ORDER BY [l].[Id], [l3].[Id] +ORDER BY [l].[Id] """); } @@ -1656,7 +1656,7 @@ LEFT JOIN ( FROM [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l2] LEFT JOIN [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l3] ON [l2].[OneToOne_Optional_Self1Id] = [l3].[Id] ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Self_Inverse1Id] -ORDER BY [l].[Id], [l0].[Id], [l1].[Id], [s].[Id] +ORDER BY [l].[Id], [l1].[Id] """); } @@ -1714,7 +1714,7 @@ public override async Task Lift_projection_mapping_when_pushing_down_subquery(bo """ @p='25' -SELECT [l2].[Id], [l4].[Id], [l1].[Id], [l4].[c] +SELECT [l2].[Id], [l1].[Id], [l4].[Id], [l4].[c] FROM ( SELECT TOP(@p) [l].[Id] FROM [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] @@ -1728,7 +1728,7 @@ LEFT JOIN ( WHERE [l3].[row] <= 1 ) AS [l4] ON [l2].[Id] = [l4].[OneToMany_Required_Inverse2Id] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [l2].[Id] = [l1].[OneToMany_Required_Inverse2Id] -ORDER BY [l2].[Id], [l4].[Id] +ORDER BY [l2].[Id] """); } @@ -1778,7 +1778,7 @@ LEFT JOIN ( LEFT JOIN [LevelThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l3] ON [l2].[Id] = [l3].[OneToMany_Optional_Inverse3Id] ) AS [s] ON [l0].[Id] = [s].[OneToMany_Optional_Inverse3Id] ) AS [s0] ON [l].[Id] = [s0].[OneToMany_Optional_Inverse2Id] -ORDER BY [l].[Id], [s0].[Id], [s0].[Id0], [s0].[Id00] +ORDER BY [l].[Id], [s0].[Id], [s0].[Id0] """); } @@ -1864,20 +1864,20 @@ await base.Complex_SelectMany_with_nested_navigations_and_explicit_DefaultIfEmpt AssertSql( """ -SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l2].[PeriodEnd], [l2].[PeriodStart], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l12].[Id], [l13].[Id], [l14].[Id], [l16].[Id], [l16].[Date], [l16].[Level1_Optional_Id], [l16].[Level1_Required_Id], [l16].[Name], [l16].[OneToMany_Optional_Inverse2Id], [l16].[OneToMany_Optional_Self_Inverse2Id], [l16].[OneToMany_Required_Inverse2Id], [l16].[OneToMany_Required_Self_Inverse2Id], [l16].[OneToOne_Optional_PK_Inverse2Id], [l16].[OneToOne_Optional_Self2Id], [l16].[PeriodEnd], [l16].[PeriodStart], [l14].[Name] +SELECT [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id], [l2].[PeriodEnd], [l2].[PeriodStart], [l].[Id], [l0].[Id], [l1].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l12].[Id], [l14].[Id], [l16].[Id], [l16].[Date], [l16].[Level1_Optional_Id], [l16].[Level1_Required_Id], [l16].[Name], [l16].[OneToMany_Optional_Inverse2Id], [l16].[OneToMany_Optional_Self_Inverse2Id], [l16].[OneToMany_Required_Inverse2Id], [l16].[OneToMany_Required_Self_Inverse2Id], [l16].[OneToOne_Optional_PK_Inverse2Id], [l16].[OneToOne_Optional_Self2Id], [l16].[PeriodEnd], [l16].[PeriodStart], [l14].[Name] FROM [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l0] ON [l].[Id] = [l0].[Level1_Required_Id] LEFT JOIN [LevelThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [l0].[Id] = [l1].[Level2_Optional_Id] LEFT JOIN [LevelFour] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l2] ON [l1].[Id] = [l2].[OneToMany_Required_Inverse4Id] INNER JOIN ( - SELECT [l3].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l6].[Id] AS [Id2] + SELECT [l3].[Id], [l6].[Id] AS [Id2] FROM [LevelFour] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l3] INNER JOIN [LevelThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l4] ON [l3].[Level3_Required_Id] = [l4].[Id] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l5] ON [l4].[Level2_Optional_Id] = [l5].[Id] LEFT JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l6] ON [l5].[Id] = [l6].[OneToMany_Required_Self_Inverse2Id] ) AS [s] ON [l2].[Id] = [s].[Id2] LEFT JOIN ( - SELECT [l7].[Id], [l8].[Id] AS [Id0], [l9].[Id] AS [Id1], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] + SELECT [l7].[Id], [l10].[Id] AS [Id2], [l10].[Level2_Optional_Id] AS [Level2_Optional_Id0] FROM [LevelFour] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l7] INNER JOIN [LevelThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l8] ON [l7].[Level3_Required_Id] = [l8].[Id] INNER JOIN [LevelTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l9] ON [l8].[Level2_Required_Id] = [l9].[Id] @@ -1893,7 +1893,7 @@ LEFT JOIN ( WHERE [l15].[Id] <> 42 ) AS [l16] ON [s].[Id2] = [l16].[OneToMany_Optional_Self_Inverse2Id] WHERE [l11].[Name] <> N'Foo' OR [l11].[Name] IS NULL -ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id2], [s0].[Id], [s0].[Id0], [s0].[Id1], [s0].[Id2], [l11].[Id], [l13].[Id], [l14].[Id] +ORDER BY [l12].[Id], [l].[Id], [l0].[Id], [l1].[Id], [l2].[Id], [s].[Id], [s].[Id2], [s0].[Id], [s0].[Id2], [l14].[Id] """); } @@ -2147,7 +2147,7 @@ public override async Task Select_subquery_single_nested_subquery(bool async) AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l1].[Id], [l3].[c] +SELECT [l].[Id], [l1].[Id], [l3].[c] FROM [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN ( SELECT [l2].[c], [l2].[Id], [l2].[OneToMany_Optional_Inverse2Id] @@ -2158,7 +2158,7 @@ LEFT JOIN ( WHERE [l2].[row] <= 1 ) AS [l3] ON [l].[Id] = [l3].[OneToMany_Optional_Inverse2Id] LEFT JOIN [LevelThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [l3].[Id] = [l1].[OneToMany_Optional_Inverse3Id] -ORDER BY [l].[Id], [l3].[Id], [l1].[Id] +ORDER BY [l].[Id], [l1].[Id] """); } @@ -2792,7 +2792,7 @@ LEFT JOIN ( FROM [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l2] LEFT JOIN [LevelOne] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l3] ON [l2].[OneToOne_Optional_Self1Id] = [l3].[Id] ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Self_Inverse1Id] -ORDER BY [l].[Id], [l0].[Id], [l1].[Id], [s].[Id] +ORDER BY [l].[Id], [l1].[Id] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs index adbbd671057..04ae924a74b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalComplexNavigationsCollectionsSharedTypeQuerySqlServerTest.cs @@ -165,7 +165,7 @@ public override async Task Complex_query_with_let_collection_projection_FirstOrD AssertSql( """ -SELECT [l].[Id], [l4].[Id], [l5].[Name], [l5].[Id], [l4].[c] +SELECT [l].[Id], [l5].[Name], [l5].[Id], [l4].[c] FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN ( SELECT [l3].[c], [l3].[Id], [l3].[OneToOne_Required_PK_Date], [l3].[Level1_Required_Id], [l3].[OneToMany_Required_Inverse2Id], [l3].[PeriodEnd], [l3].[PeriodStart], [l3].[OneToMany_Optional_Inverse2Id] @@ -186,7 +186,7 @@ SELECT 1 WHEN [l4].[OneToOne_Required_PK_Date] IS NOT NULL AND [l4].[Level1_Required_Id] IS NOT NULL AND [l4].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l4].[Id] END) ) AS [l5] -ORDER BY [l].[Id], [l4].[Id] +ORDER BY [l].[Id] """); } @@ -1486,7 +1486,7 @@ LEFT JOIN ( FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l5] ON [l4].[Id] = [l5].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -1516,7 +1516,7 @@ LEFT JOIN ( FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l5] ON [l4].[Id] = [l5].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -1547,7 +1547,7 @@ LEFT JOIN ( FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l5] ON [l4].[Id] = [l5].[OneToMany_Optional_Inverse2Id] -ORDER BY [l2].[Name], [l4].[Id] +ORDER BY [l2].[Name] """); } @@ -1892,17 +1892,17 @@ public override async Task Lift_projection_mapping_when_pushing_down_subquery(bo """ @p='25' -SELECT [l2].[Id], [l4].[Id0], [l5].[Id], [l5].[Id0], [l4].[Id], [l4].[c] +SELECT [l2].[Id], [l5].[Id], [l5].[Id0], [l4].[Id], [l4].[c] FROM ( SELECT TOP(@p) [l].[Id] FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] ) AS [l2] LEFT JOIN ( - SELECT [l3].[Id], [l3].[c], [l3].[Id0], [l3].[OneToMany_Required_Inverse2Id] + SELECT [l3].[Id], [l3].[c], [l3].[OneToMany_Required_Inverse2Id] FROM ( SELECT CASE WHEN [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] IS NOT NULL AND [l0].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l0].[Id] - END AS [Id], 1 AS [c], [l0].[Id] AS [Id0], [l0].[OneToMany_Required_Inverse2Id], ROW_NUMBER() OVER(PARTITION BY [l0].[OneToMany_Required_Inverse2Id] ORDER BY [l0].[Id]) AS [row] + END AS [Id], 1 AS [c], [l0].[OneToMany_Required_Inverse2Id], ROW_NUMBER() OVER(PARTITION BY [l0].[OneToMany_Required_Inverse2Id] ORDER BY [l0].[Id]) AS [row] FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l0] WHERE [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] IS NOT NULL AND [l0].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l3] @@ -1915,7 +1915,7 @@ WHEN [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] WHERE [l1].[OneToOne_Required_PK_Date] IS NOT NULL AND [l1].[Level1_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [l5] ON [l2].[Id] = [l5].[OneToMany_Required_Inverse2Id] -ORDER BY [l2].[Id], [l4].[Id0] +ORDER BY [l2].[Id] """); } @@ -2853,7 +2853,7 @@ public override async Task Select_subquery_single_nested_subquery(bool async) AssertSql( """ -SELECT [l].[Id], [l3].[Id], [l4].[Id], [l4].[Id0], [l3].[c] +SELECT [l].[Id], [l4].[Id], [l4].[Id0], [l3].[c] FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN ( SELECT [l2].[c], [l2].[Id], [l2].[OneToOne_Required_PK_Date], [l2].[Level1_Required_Id], [l2].[OneToMany_Required_Inverse2Id], [l2].[PeriodEnd], [l2].[PeriodStart], [l2].[OneToMany_Optional_Inverse2Id] @@ -2875,7 +2875,7 @@ WHERE [l1].[Level2_Required_Id] IS NOT NULL AND [l1].[OneToMany_Required_Inverse ) AS [l4] ON CASE WHEN [l3].[OneToOne_Required_PK_Date] IS NOT NULL AND [l3].[Level1_Required_Id] IS NOT NULL AND [l3].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l3].[Id] END = [l4].[OneToMany_Optional_Inverse3Id] -ORDER BY [l].[Id], [l3].[Id], [l4].[Id] +ORDER BY [l].[Id], [l4].[Id] """); } @@ -2885,10 +2885,10 @@ public override async Task Select_subquery_single_nested_subquery2(bool async) AssertSql( """ -SELECT [l].[Id], [s].[Id], [s].[Id0], [s].[Id1], [s].[Id00], [s].[c] +SELECT [l].[Id], [s].[Id], [s].[Id0], [s].[Id00], [s].[c] FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN ( - SELECT [l0].[Id], [l4].[Id] AS [Id0], [l5].[Id] AS [Id1], [l5].[Id0] AS [Id00], [l4].[c], CASE + SELECT [l0].[Id], [l5].[Id] AS [Id0], [l5].[Id0] AS [Id00], [l4].[c], CASE WHEN [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] IS NOT NULL AND [l0].[OneToMany_Required_Inverse2Id] IS NOT NULL THEN [l0].[Id] END AS [c0], [l0].[OneToMany_Optional_Inverse2Id] FROM [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l0] @@ -2916,7 +2916,7 @@ WHEN [l4].[Level2_Required_Id] IS NOT NULL AND [l4].[OneToMany_Required_Inverse3 END = [l5].[OneToMany_Optional_Inverse4Id] WHERE [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] IS NOT NULL AND [l0].[OneToMany_Required_Inverse2Id] IS NOT NULL ) AS [s] ON [l].[Id] = [s].[OneToMany_Optional_Inverse2Id] -ORDER BY [l].[Id], [s].[c0], [s].[Id], [s].[Id0], [s].[Id1] +ORDER BY [l].[Id], [s].[c0], [s].[Id], [s].[Id0] """); } @@ -3167,7 +3167,7 @@ OFFSET 1 ROWS FETCH NEXT 3 ROWS ONLY ) AS [l2] INNER JOIN [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [l2].[Level1_Required_Id] = [l1].[Id] ) AS [s] -ORDER BY [l3].[Id], [s].[c], [s].[Id1] +ORDER BY [l3].[Id], [s].[c] """); } @@ -3270,7 +3270,7 @@ WHEN [l0].[OneToOne_Required_PK_Date] IS NOT NULL AND [l0].[Level1_Required_Id] ) AS [l2] INNER JOIN [Level1] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [l2].[Level1_Required_Id] = [l1].[Id] ) AS [s] -ORDER BY [l3].[Id], [s].[c], [s].[Id1] +ORDER BY [l3].[Id], [s].[c] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs index b2135e79e33..7103f0bd734 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs @@ -240,7 +240,7 @@ public override async Task Accessing_property_of_optional_navigation_in_child_pr SELECT CASE WHEN [g].[Nickname] IS NOT NULL AND [g].[SquadId] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) -END, [t].[Id], [g].[Nickname], [g].[SquadId], [s].[Nickname], [s].[Id], [s].[SquadId] +END, [t].[Id], [s].[Nickname], [s].[Id], [s].[SquadId] FROM [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN ( @@ -248,7 +248,7 @@ LEFT JOIN ( FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON [w].[OwnerFullName] = [g0].[FullName] ) AS [s] ON [g].[FullName] = [s].[OwnerFullName] -ORDER BY [t].[Note], [t].[Id], [g].[Nickname], [g].[SquadId], [s].[Id], [s].[Nickname] +ORDER BY [t].[Note], [t].[Id], [s].[Id], [s].[Nickname] """); } @@ -258,14 +258,14 @@ public override async Task Accessing_reference_navigation_collection_composition AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [s].[Id], [s].[IsAutomatic], [s].[Name], [s].[Id0] +SELECT [g].[Nickname], [g].[SquadId], [s].[Id], [s].[IsAutomatic], [s].[Name] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN ( - SELECT [w].[Id], [w].[IsAutomatic], [w0].[Name], [w0].[Id] AS [Id0], [w].[OwnerFullName] + SELECT [w].[Id], [w].[IsAutomatic], [w0].[Name], [w].[OwnerFullName] FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] LEFT JOIN [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w0] ON [w].[SynergyWithId] = [w0].[Id] ) AS [s] ON [g].[FullName] = [s].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [s].[Id] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -576,11 +576,6 @@ public override async Task Where_subquery_left_join_firstordefault_boolean(bool WHERE [g].[HasSoulPatch] = CAST(1 AS bit) AND ( SELECT TOP(1) [w].[IsAutomatic] FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] - LEFT JOIN ( - SELECT [w0].[Id] - FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w0] - WHERE [g].[FullName] = [w0].[OwnerFullName] - ) AS [w1] ON [w].[Id] = [w1].[Id] WHERE [g].[FullName] = [w].[OwnerFullName] ORDER BY [w].[Id]) = CAST(1 AS bit) """); @@ -940,13 +935,13 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN ( - SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Id0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g0].[HasSoulPatch] AS [HasSoulPatch0], [s0].[IsAutomatic], [s0].[Name], [g0].[LeaderNickname], [g0].[LeaderSquadId] + SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g0].[HasSoulPatch] AS [HasSoulPatch0], [s0].[IsAutomatic], [s0].[Name], [g0].[LeaderNickname], [g0].[LeaderSquadId] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] LEFT JOIN ( - SELECT [w].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id] AS [Id0], [g2].[Nickname] AS [Nickname0], [g2].[HasSoulPatch], [g2].[SquadId] AS [SquadId0], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName] + SELECT [w].[Id], [g1].[Nickname], [g1].[SquadId], [g2].[Nickname] AS [Nickname0], [g2].[HasSoulPatch], [g2].[SquadId] AS [SquadId0], [w].[IsAutomatic], [w].[Name], [w].[OwnerFullName] FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [w].[OwnerFullName] = [g1].[FullName] LEFT JOIN [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [g1].[SquadId] = [s].[Id] @@ -954,7 +949,7 @@ LEFT JOIN ( ) AS [s0] ON [g0].[FullName] = [s0].[OwnerFullName] ) AS [s1] ON [g].[Nickname] = [s1].[LeaderNickname] AND [g].[SquadId] = [s1].[LeaderSquadId] WHERE [g].[Discriminator] = N'Officer' -ORDER BY [g].[HasSoulPatch], [g].[LeaderNickname], [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[HasSoulPatch0] DESC, [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic], [s1].[Name] DESC, [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00] +ORDER BY [g].[HasSoulPatch], [g].[LeaderNickname], [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[HasSoulPatch0] DESC, [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic], [s1].[Name] DESC, [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00] """); } @@ -986,13 +981,13 @@ public override async Task Correlated_collections_complex_scenario2(bool async) AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN ( - SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Id0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g0].[LeaderNickname], [g0].[LeaderSquadId] + SELECT [g0].[FullName], [g0].[Nickname], [g0].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g0].[LeaderNickname], [g0].[LeaderSquadId] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] LEFT JOIN ( - SELECT [w].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id] AS [Id0], [g2].[Nickname] AS [Nickname0], [g2].[HasSoulPatch], [g2].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [g1].[Nickname], [g1].[SquadId], [g2].[Nickname] AS [Nickname0], [g2].[HasSoulPatch], [g2].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [w].[OwnerFullName] = [g1].[FullName] LEFT JOIN [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [g1].[SquadId] = [s].[Id] @@ -1000,7 +995,7 @@ LEFT JOIN ( ) AS [s0] ON [g0].[FullName] = [s0].[OwnerFullName] ) AS [s1] ON [g].[Nickname] = [s1].[LeaderNickname] AND [g].[SquadId] = [s1].[LeaderSquadId] WHERE [g].[Discriminator] = N'Officer' -ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00] +ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Nickname00] """); } @@ -1320,7 +1315,7 @@ GROUP BY [g].[Rank] LEFT JOIN ( SELECT [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[Discriminator], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[PeriodEnd], [s].[PeriodStart], [s].[Rank], [s].[Name], [s].[Location], [s].[Nation], [s].[PeriodEnd0], [s].[PeriodStart0] FROM ( - SELECT [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank], [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd] AS [PeriodEnd0], [c].[PeriodStart] AS [PeriodStart0], ROW_NUMBER() OVER(PARTITION BY [g0].[Rank] ORDER BY [g0].[Nickname], [g0].[SquadId], [c].[Name]) AS [row] + SELECT [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank], [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd] AS [PeriodEnd0], [c].[PeriodStart] AS [PeriodStart0], ROW_NUMBER() OVER(PARTITION BY [g0].[Rank] ORDER BY [g0].[Nickname], [g0].[SquadId]) AS [row] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] INNER JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g0].[CityOfBirthName] = [c].[Name] WHERE [g0].[HasSoulPatch] = CAST(1 AS bit) @@ -1804,7 +1799,7 @@ public override async Task Include_with_join_collection2(bool async) FROM [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] INNER JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [t].[GearSquadId] = [g].[SquadId] AND [t].[GearNickName] = [g].[Nickname] LEFT JOIN [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] ON [g].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId] +ORDER BY [t].[Id] """); } @@ -1940,12 +1935,12 @@ public override async Task Project_collection_navigation_nested_composite_key(bo AssertSql( """ -SELECT [t].[Id], [g].[Nickname], [g].[SquadId], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] +SELECT [t].[Id], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] FROM [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] WHERE [g].[Discriminator] = N'Officer' -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [t].[Id], [g0].[Nickname] """); } @@ -1960,7 +1955,7 @@ public override async Task Cast_to_derived_followed_by_multiple_includes(bool as LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [l].[DefeatedByNickname] = [g].[Nickname] AND [l].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] ON [g].[FullName] = [w].[OwnerFullName] WHERE [l].[Name] LIKE N'%Queen%' -ORDER BY [l].[Name], [g].[Nickname], [g].[SquadId] +ORDER BY [l].[Name] """); } @@ -2264,10 +2259,10 @@ public override async Task Correlated_collections_nested(bool async) AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0], [s3].[PeriodEnd], [s3].[PeriodStart] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0], [s3].[PeriodEnd], [s3].[PeriodStart] FROM [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0], [s2].[PeriodEnd], [s2].[PeriodStart] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0], [s2].[PeriodEnd], [s2].[PeriodStart] FROM [SquadMissions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s0] INNER JOIN [Missions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -2277,7 +2272,7 @@ WHERE [s1].[SquadId] < 7 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 42 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -2505,7 +2500,7 @@ LEFT JOIN ( WHERE [l].[Discriminator] = N'LocustCommander' ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [LocustLeaders] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [f].[Id] = [l1].[LocustHordeId] -ORDER BY [f].[Name], [f].[Id], [l0].[Name] +ORDER BY [f].[Name], [f].[Id] """); } @@ -3012,15 +3007,15 @@ public override async Task Correlated_collections_multiple_nested_complex_collec AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Name], [s1].[IsAutomatic], [s1].[Id1], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00], [s2].[Id], [s2].[AmmunitionType], [s2].[IsAutomatic], [s2].[Name], [s2].[OwnerFullName], [s2].[PeriodEnd], [s2].[PeriodStart], [s2].[SynergyWithId], [s2].[Nickname], [s2].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[FullName], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Name], [s1].[IsAutomatic], [s1].[Id0], [s1].[Nickname00], [s1].[HasSoulPatch], [s1].[SquadId00], [s2].[Id], [s2].[AmmunitionType], [s2].[IsAutomatic], [s2].[Name], [s2].[OwnerFullName], [s2].[PeriodEnd], [s2].[PeriodStart], [s2].[SynergyWithId], [s2].[Nickname], [s2].[SquadId] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [t].[GearNickName] = [g1].[Nickname] AND [t].[GearSquadId] = [g1].[SquadId] LEFT JOIN ( - SELECT [g2].[FullName], [g2].[Nickname], [g2].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Id0], [s0].[Name], [s0].[IsAutomatic], [s0].[Id1], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g2].[Rank], [s0].[IsAutomatic0], [g2].[LeaderNickname], [g2].[LeaderSquadId] + SELECT [g2].[FullName], [g2].[Nickname], [g2].[SquadId], [s0].[Id], [s0].[Nickname] AS [Nickname0], [s0].[SquadId] AS [SquadId0], [s0].[Name], [s0].[IsAutomatic], [s0].[Id0], [s0].[Nickname0] AS [Nickname00], [s0].[HasSoulPatch], [s0].[SquadId0] AS [SquadId00], [g2].[Rank], [s0].[IsAutomatic0], [g2].[LeaderNickname], [g2].[LeaderSquadId] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g2] LEFT JOIN ( - SELECT [w].[Id], [g3].[Nickname], [g3].[SquadId], [s].[Id] AS [Id0], [w0].[Name], [w0].[IsAutomatic], [w0].[Id] AS [Id1], [g4].[Nickname] AS [Nickname0], [g4].[HasSoulPatch], [g4].[SquadId] AS [SquadId0], [w].[IsAutomatic] AS [IsAutomatic0], [w].[OwnerFullName] + SELECT [w].[Id], [g3].[Nickname], [g3].[SquadId], [w0].[Name], [w0].[IsAutomatic], [w0].[Id] AS [Id0], [g4].[Nickname] AS [Nickname0], [g4].[HasSoulPatch], [g4].[SquadId] AS [SquadId0], [w].[IsAutomatic] AS [IsAutomatic0], [w].[OwnerFullName] FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g3] ON [w].[OwnerFullName] = [g3].[FullName] LEFT JOIN [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [g3].[SquadId] = [s].[Id] @@ -3039,7 +3034,7 @@ LEFT JOIN ( SELECT 1 FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s1].[Rank], [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic0], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Id1], [s1].[Nickname00], [s1].[SquadId00], [s2].[IsAutomatic], [s2].[Nickname] DESC, [s2].[Id] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s1].[Rank], [s1].[Nickname], [s1].[SquadId], [s1].[IsAutomatic0], [s1].[Id], [s1].[Nickname0], [s1].[SquadId0], [s1].[Id0], [s1].[Nickname00], [s1].[SquadId00], [s2].[IsAutomatic], [s2].[Nickname] DESC, [s2].[Id] """); } @@ -3372,7 +3367,7 @@ public override async Task Project_collection_navigation_nested_with_take_compos AssertSql( """ -SELECT [t].[Id], [g].[Nickname], [g].[SquadId], [g2].[Nickname], [g2].[SquadId], [g2].[AssignedCityName], [g2].[CityOfBirthName], [g2].[Discriminator], [g2].[FullName], [g2].[HasSoulPatch], [g2].[LeaderNickname], [g2].[LeaderSquadId], [g2].[PeriodEnd], [g2].[PeriodStart], [g2].[Rank] +SELECT [t].[Id], [g2].[Nickname], [g2].[SquadId], [g2].[AssignedCityName], [g2].[CityOfBirthName], [g2].[Discriminator], [g2].[FullName], [g2].[HasSoulPatch], [g2].[LeaderNickname], [g2].[LeaderSquadId], [g2].[PeriodEnd], [g2].[PeriodStart], [g2].[Rank] FROM [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN ( @@ -3384,7 +3379,7 @@ LEFT JOIN ( WHERE [g1].[row] <= 50 ) AS [g2] ON ([g].[Nickname] = [g2].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g2].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g2].[LeaderSquadId] WHERE [g].[Discriminator] = N'Officer' -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId], [g2].[Nickname] +ORDER BY [t].[Id], [g2].[Nickname] """); } @@ -3688,16 +3683,16 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN ( - SELECT [w].[Id], [g0].[Nickname], [g0].[SquadId], [s].[Id] AS [Id0], [g1].[Nickname] AS [Nickname0], [g1].[HasSoulPatch], [g1].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [g0].[Nickname], [g0].[SquadId], [g1].[Nickname] AS [Nickname0], [g1].[HasSoulPatch], [g1].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON [w].[OwnerFullName] = [g0].[FullName] LEFT JOIN [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [g0].[SquadId] = [s].[Id] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [s].[Id] = [g1].[SquadId] ) AS [s0] ON [g].[FullName] = [s0].[OwnerFullName] -ORDER BY [g].[FullName], [g].[Nickname] DESC, [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0] +ORDER BY [g].[FullName], [g].[Nickname] DESC, [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0] """); } @@ -3785,7 +3780,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[PeriodEnd], [s].[PeriodStart], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[PeriodEnd], [s].[PeriodStart], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [t].[GearNickName] = [g1].[Nickname] AND [t].[GearSquadId] = [g1].[SquadId] @@ -3798,7 +3793,7 @@ LEFT JOIN ( SELECT 1 FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] """); } @@ -3871,7 +3866,7 @@ public override async Task Correlated_collection_take(bool async) AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [c].[Name], [w1].[Id], [w1].[AmmunitionType], [w1].[IsAutomatic], [w1].[Name], [w1].[OwnerFullName], [w1].[PeriodEnd], [w1].[PeriodStart], [w1].[SynergyWithId], [c].[Location], [c].[Nation], [c].[PeriodEnd], [c].[PeriodStart] +SELECT [g].[Nickname], [g].[SquadId], [w1].[Id], [w1].[AmmunitionType], [w1].[IsAutomatic], [w1].[Name], [w1].[OwnerFullName], [w1].[PeriodEnd], [w1].[PeriodStart], [w1].[SynergyWithId], [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd], [c].[PeriodStart] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] INNER JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN ( @@ -3882,7 +3877,7 @@ LEFT JOIN ( ) AS [w0] WHERE [w0].[row] <= 10 ) AS [w1] ON [g].[FullName] = [w1].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -3923,7 +3918,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[PeriodEnd], [s].[PeriodStart], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[PeriodEnd], [s].[PeriodStart], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [t].[GearNickName] = [g1].[Nickname] AND [t].[GearSquadId] = [g1].[SquadId] @@ -3939,7 +3934,7 @@ SELECT COUNT(*) SELECT 1 FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id] DESC, [s].[c], [s].[Nickname] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Id] DESC, [s].[c], [s].[Nickname] """); } @@ -3957,7 +3952,7 @@ LEFT JOIN ( FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] INNER JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g0].[CityOfBirthName] = [c].[Name] ) AS [s] ON ([g].[Nickname] = [s].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [s].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [s].[LeaderSquadId] -ORDER BY [l].[Name], [g].[Nickname], [g].[SquadId], [s].[Nickname], [s].[SquadId] +ORDER BY [l].[Name], [s].[Nickname] """); } @@ -4707,16 +4702,16 @@ public override async Task Correlated_collections_complex_scenario1(bool async) AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0], [s0].[HasSoulPatch], [s0].[SquadId0] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN ( - SELECT [w].[Id], [g0].[Nickname], [g0].[SquadId], [s].[Id] AS [Id0], [g1].[Nickname] AS [Nickname0], [g1].[HasSoulPatch], [g1].[SquadId] AS [SquadId0], [w].[OwnerFullName] + SELECT [w].[Id], [g0].[Nickname], [g0].[SquadId], [g1].[Nickname] AS [Nickname0], [g1].[HasSoulPatch], [g1].[SquadId] AS [SquadId0], [w].[OwnerFullName] FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON [w].[OwnerFullName] = [g0].[FullName] LEFT JOIN [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [g0].[SquadId] = [s].[Id] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [s].[Id] = [g1].[SquadId] ) AS [s0] ON [g].[FullName] = [s0].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id0], [s0].[Nickname0] +ORDER BY [g].[Nickname], [g].[SquadId], [s0].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Nickname0] """); } @@ -4832,7 +4827,7 @@ LEFT JOIN ( ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [l0].[DefeatedByNickname] = [g].[Nickname] AND [l0].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] -ORDER BY [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [f].[Id], [g0].[Nickname] """); } @@ -4843,7 +4838,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[PeriodEnd], [s].[PeriodStart], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] +SELECT [g].[FullName], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[Id], [s].[AmmunitionType], [s].[IsAutomatic], [s].[Name], [s].[OwnerFullName], [s].[PeriodEnd], [s].[PeriodStart], [s].[SynergyWithId], [s].[Nickname], [s].[SquadId] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] LEFT JOIN [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] ON [g].[Nickname] = [t].[GearNickName] AND [g].[SquadId] = [t].[GearSquadId] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [t].[GearNickName] = [g1].[Nickname] AND [t].[GearSquadId] = [g1].[SquadId] @@ -4856,7 +4851,7 @@ LEFT JOIN ( SELECT 1 FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] WHERE [g].[Nickname] = [g0].[LeaderNickname] AND [g].[SquadId] = [g0].[LeaderSquadId]) -ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [g1].[Nickname], [g1].[SquadId], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] +ORDER BY [g].[HasSoulPatch] DESC, [t].[Note], [g].[Nickname], [g].[SquadId], [t].[Id], [s].[IsAutomatic], [s].[Nickname] DESC, [s].[Id] """); } @@ -5074,7 +5069,7 @@ LEFT JOIN ( ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [l0].[DefeatedByNickname] = [g].[Nickname] AND [l0].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] -ORDER BY [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [f].[Id], [g0].[Nickname] """); } @@ -5245,7 +5240,7 @@ LEFT JOIN ( ) AS [w1] WHERE [w1].[row] <= 1 ) AS [w2] ON [g].[FullName] = [w2].[OwnerFullName] -ORDER BY [g].[Nickname], [g].[SquadId], [s].[Id] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -5465,10 +5460,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0], [s3].[PeriodEnd], [s3].[PeriodStart] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0], [s3].[PeriodEnd], [s3].[PeriodStart] FROM [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0], [s2].[PeriodEnd], [s2].[PeriodStart] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0], [s2].[PeriodEnd], [s2].[PeriodStart] FROM [SquadMissions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s0] INNER JOIN [Missions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -5478,7 +5473,7 @@ WHERE [s1].[SquadId] < 2 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 3 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -5557,10 +5552,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0], [s3].[MissionId0], [s3].[PeriodEnd], [s3].[PeriodStart] +SELECT [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0], [s3].[MissionId0], [s3].[PeriodEnd], [s3].[PeriodStart] FROM [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] LEFT JOIN ( - SELECT [s0].[SquadId], [s0].[MissionId], [m].[Id], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0], [s2].[PeriodEnd], [s2].[PeriodStart] + SELECT [s0].[SquadId], [s0].[MissionId], [s2].[SquadId] AS [SquadId0], [s2].[MissionId] AS [MissionId0], [s2].[PeriodEnd], [s2].[PeriodStart] FROM [SquadMissions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s0] INNER JOIN [Missions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [m] ON [s0].[MissionId] = [m].[Id] LEFT JOIN ( @@ -5570,7 +5565,7 @@ WHERE [s1].[SquadId] < 7 ) AS [s2] ON [m].[Id] = [s2].[MissionId] WHERE [s0].[MissionId] < 42 ) AS [s3] ON [s].[Id] = [s3].[SquadId] -ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[Id], [s3].[SquadId0] +ORDER BY [s].[Id], [s3].[SquadId], [s3].[MissionId], [s3].[SquadId0] """); } @@ -5810,7 +5805,7 @@ INNER JOIN ( WHERE [g].[Discriminator] = N'Officer' ) AS [g0] ON [t].[GearSquadId] = [g0].[SquadId] AND [t].[GearNickName] = [g0].[Nickname] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [g0].[Nickname] = [g1].[LeaderNickname] AND [g0].[SquadId] = [g1].[LeaderSquadId] -ORDER BY [t].[Id], [g0].[Nickname], [g0].[SquadId], [g1].[Nickname] +ORDER BY [t].[Id], [g1].[Nickname] """); } @@ -5996,7 +5991,7 @@ SELECT TOP(@p) [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[Period ORDER BY [t].[Note] ) AS [s] LEFT JOIN [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] ON [s].[FullName] = [w].[OwnerFullName] -ORDER BY [s].[Note], [s].[Name], [s].[Nickname], [s].[SquadId], [s].[Id] +ORDER BY [s].[Note], [s].[Name], [s].[Id] """); } @@ -6124,7 +6119,7 @@ public override async Task Correlated_collections_deeply_nested_left_join(bool a AssertSql( """ -SELECT [t].[Id], [g].[Nickname], [g].[SquadId], [s].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[SynergyWithId] +SELECT [t].[Id], [g].[Nickname], [g].[SquadId], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[SynergyWithId] FROM [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [t].[GearNickName] = [g].[Nickname] LEFT JOIN [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [g].[SquadId] = [s].[Id] @@ -6138,7 +6133,7 @@ LEFT JOIN ( ) AS [w0] ON [g0].[FullName] = [w0].[OwnerFullName] WHERE [g0].[HasSoulPatch] = CAST(1 AS bit) ) AS [s0] ON [s].[Id] = [s0].[SquadId] -ORDER BY [t].[Note], [g].[Nickname] DESC, [t].[Id], [g].[SquadId], [s].[Id], [s0].[Nickname], [s0].[SquadId] +ORDER BY [t].[Note], [g].[Nickname] DESC, [t].[Id], [g].[SquadId], [s0].[Nickname], [s0].[SquadId] """); } @@ -6329,7 +6324,7 @@ public override async Task ThenInclude_collection_on_derived_after_base_referenc FROM [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] ON [g].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId] +ORDER BY [t].[Id] """); } @@ -6415,7 +6410,7 @@ LEFT JOIN ( FROM [LocustLeaders] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [l].[DefeatedByNickname] = [g].[Nickname] AND [l].[DefeatedBySquadId] = [g].[SquadId] ) AS [s] ON [f].[Id] = [s].[LocustHordeId] -ORDER BY [f].[Id], [s].[Name], [s].[Nickname] +ORDER BY [f].[Id] """); } @@ -6613,7 +6608,7 @@ public override async Task Project_collection_navigation_with_inheritance2(bool AssertSql( """ -SELECT [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] +SELECT [f].[Id], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[DefeatedByNickname], [l].[DefeatedBySquadId] @@ -6622,7 +6617,7 @@ LEFT JOIN ( ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [l0].[DefeatedByNickname] = [g].[Nickname] AND [l0].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] -ORDER BY [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [f].[Id], [g0].[Nickname] """); } @@ -6842,7 +6837,7 @@ public override async Task Correlated_collections_from_left_join_with_additional AssertSql( """ -SELECT [w].[Id], [g].[Nickname], [g].[SquadId], [s].[Id], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[SynergyWithId], [s0].[Rank] +SELECT [w].[Id], [g].[Nickname], [g].[SquadId], [s0].[Nickname], [s0].[SquadId], [s0].[Id], [s0].[AmmunitionType], [s0].[IsAutomatic], [s0].[Name], [s0].[OwnerFullName], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[SynergyWithId], [s0].[Rank] FROM [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [w].[OwnerFullName] = [g].[FullName] LEFT JOIN [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [g].[SquadId] = [s].[Id] @@ -6855,7 +6850,7 @@ LEFT JOIN ( WHERE [w0].[IsAutomatic] = CAST(0 AS bit) ) AS [w1] ON [g0].[FullName] = [w1].[OwnerFullName] ) AS [s0] ON [s].[Id] = [s0].[SquadId] -ORDER BY [w].[Name], [w].[Id], [g].[Nickname], [g].[SquadId], [s].[Id], [s0].[FullName] DESC, [s0].[Nickname], [s0].[SquadId], [s0].[Id] +ORDER BY [w].[Name], [w].[Id], [g].[Nickname], [g].[SquadId], [s0].[FullName] DESC, [s0].[Nickname], [s0].[SquadId], [s0].[Id] """); } @@ -6865,7 +6860,7 @@ public override async Task Project_collection_navigation_with_inheritance3(bool AssertSql( """ -SELECT [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] +SELECT [f].[Id], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[DefeatedByNickname], [l].[DefeatedBySquadId] @@ -6874,7 +6869,7 @@ LEFT JOIN ( ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [l0].[DefeatedByNickname] = [g].[Nickname] AND [l0].[DefeatedBySquadId] = [g].[SquadId] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON ([g].[Nickname] = [g0].[LeaderNickname] OR ([g].[Nickname] IS NULL AND [g0].[LeaderNickname] IS NULL)) AND [g].[SquadId] = [g0].[LeaderSquadId] -ORDER BY [f].[Id], [l0].[Name], [g].[Nickname], [g].[SquadId], [g0].[Nickname] +ORDER BY [f].[Id], [g0].[Nickname] """); } @@ -6928,7 +6923,7 @@ LEFT JOIN ( INNER JOIN [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [g0].[SquadId] = [s].[Id] LEFT JOIN [SquadMissions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s0] ON [s].[Id] = [s0].[SquadId] ) AS [s1] ON [g].[Nickname] = [s1].[LeaderNickname] AND [g].[SquadId] = [s1].[LeaderSquadId] -ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[Id], [s1].[SquadId0] +ORDER BY [g].[Nickname], [g].[SquadId], [s1].[Nickname], [s1].[SquadId], [s1].[SquadId0] """); } @@ -7230,7 +7225,7 @@ public override async Task Include_multiple_circular_with_filter(bool async) INNER JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON [c].[Name] = [g0].[AssignedCityName] WHERE [g].[Nickname] = N'Marcus' -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name], [g0].[Nickname] +ORDER BY [g].[Nickname], [g].[SquadId], [g0].[Nickname] """); } @@ -7587,7 +7582,7 @@ public override async Task Correlated_collections_projection_of_collection_thru_ AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [s].[Id], [s1].[SquadId], [s1].[MissionId], [s1].[PeriodEnd], [s1].[PeriodStart] +SELECT [g].[Nickname], [g].[SquadId], [s1].[SquadId], [s1].[MissionId], [s1].[PeriodEnd], [s1].[PeriodStart] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] INNER JOIN [Squads] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [g].[SquadId] = [s].[Id] LEFT JOIN ( @@ -7596,7 +7591,7 @@ LEFT JOIN ( WHERE [s0].[MissionId] <> 17 ) AS [s1] ON [s].[Id] = [s1].[SquadId] WHERE [g].[Nickname] <> N'Marcus' -ORDER BY [g].[FullName], [g].[Nickname], [g].[SquadId], [s].[Id], [s1].[SquadId] +ORDER BY [g].[FullName], [g].[Nickname], [g].[SquadId], [s1].[SquadId] """); } @@ -7672,7 +7667,7 @@ public override async Task Include_with_join_multi_level(bool async) INNER JOIN [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] ON [g].[SquadId] = [t].[GearSquadId] AND [g].[Nickname] = [t].[GearNickName] INNER JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON [c].[Name] = [g0].[AssignedCityName] -ORDER BY [g].[Nickname], [g].[SquadId], [t].[Id], [c].[Name], [g0].[Nickname] +ORDER BY [g].[Nickname], [g].[SquadId], [t].[Id], [g0].[Nickname] """); } @@ -7897,7 +7892,7 @@ public override async Task Include_multiple_circular(bool async) FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] INNER JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g0] ON [c].[Name] = [g0].[AssignedCityName] -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name], [g0].[Nickname] +ORDER BY [g].[Nickname], [g].[SquadId], [g0].[Nickname] """); } @@ -7907,7 +7902,7 @@ public override async Task Select_correlated_filtered_collection(bool async) AssertSql( """ -SELECT [g].[Nickname], [g].[SquadId], [c].[Name], [w0].[Id], [w0].[AmmunitionType], [w0].[IsAutomatic], [w0].[Name], [w0].[OwnerFullName], [w0].[PeriodEnd], [w0].[PeriodStart], [w0].[SynergyWithId] +SELECT [g].[Nickname], [g].[SquadId], [w0].[Id], [w0].[AmmunitionType], [w0].[IsAutomatic], [w0].[Name], [w0].[OwnerFullName], [w0].[PeriodEnd], [w0].[PeriodStart], [w0].[SynergyWithId] FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] INNER JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g].[CityOfBirthName] = [c].[Name] LEFT JOIN ( @@ -7916,7 +7911,7 @@ LEFT JOIN ( WHERE [w].[Name] <> N'Lancer' OR [w].[Name] IS NULL ) AS [w0] ON [g].[FullName] = [w0].[OwnerFullName] WHERE [c].[Name] IN (N'Ephyra', N'Hanover') -ORDER BY [g].[Nickname], [g].[SquadId], [c].[Name] +ORDER BY [g].[Nickname], [g].[SquadId] """); } @@ -8013,7 +8008,7 @@ public override async Task Project_collection_navigation_with_inheritance1(bool AssertSql( """ -SELECT [f].[Id], [l0].[Name], [f0].[Id], [l1].[Name], [l1].[Discriminator], [l1].[LocustHordeId], [l1].[PeriodEnd], [l1].[PeriodStart], [l1].[ThreatLevel], [l1].[ThreatLevelByte], [l1].[ThreatLevelNullableByte], [l1].[DefeatedByNickname], [l1].[DefeatedBySquadId], [l1].[HighCommandId] +SELECT [f].[Id], [f0].[Id], [l1].[Name], [l1].[Discriminator], [l1].[LocustHordeId], [l1].[PeriodEnd], [l1].[PeriodStart], [l1].[ThreatLevel], [l1].[ThreatLevelByte], [l1].[ThreatLevelNullableByte], [l1].[DefeatedByNickname], [l1].[DefeatedBySquadId], [l1].[HighCommandId] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name] @@ -8022,7 +8017,7 @@ SELECT [l].[Name] ) AS [l0] ON [f].[CommanderName] = [l0].[Name] LEFT JOIN [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f0] ON [l0].[Name] = [f0].[CommanderName] LEFT JOIN [LocustLeaders] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l1] ON [f0].[Id] = [l1].[LocustHordeId] -ORDER BY [f].[Id], [l0].[Name], [f0].[Id] +ORDER BY [f].[Id], [f0].[Id] """); } @@ -8051,7 +8046,7 @@ public override async Task Include_multiple_one_to_one_and_one_to_many(bool asyn FROM [Tags] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [t] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ON [t].[GearNickName] = [g].[Nickname] AND [t].[GearSquadId] = [g].[SquadId] LEFT JOIN [Weapons] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [w] ON [g].[FullName] = [w].[OwnerFullName] -ORDER BY [t].[Id], [g].[Nickname], [g].[SquadId] +ORDER BY [t].[Id] """); } @@ -8271,7 +8266,7 @@ INNER JOIN ( WHERE [g].[Discriminator] = N'Officer' ) AS [g0] ON [t].[GearSquadId] = [g0].[SquadId] AND [t].[GearNickName] = [g0].[Nickname] LEFT JOIN [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g1] ON [g0].[Nickname] = [g1].[LeaderNickname] AND [g0].[SquadId] = [g1].[LeaderSquadId] -ORDER BY [g0].[HasSoulPatch], [g0].[Nickname] DESC, [t].[Id], [g0].[SquadId], [g1].[Nickname] +ORDER BY [g0].[HasSoulPatch], [g0].[Nickname] DESC, [t].[Id], [g1].[Nickname] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs index 5b0a7279b80..a5a4a4b22c1 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs @@ -403,7 +403,7 @@ INNER JOIN ( WHERE [e0].[Discriminator] = N'EntityLeaf' ) AS [e1] ON [j].[LeafId] = [e1].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeId1] AND [e].[Key2] = [s].[CompositeId2] AND [e].[Key3] = [s].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2], [s].[CompositeId3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[LeafId], [s].[CompositeId1], [s].[CompositeId2] """); } @@ -421,7 +421,7 @@ LEFT JOIN ( INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] WHERE [e1].[Discriminator] = N'EntityLeaf' ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -607,7 +607,7 @@ LEFT JOIN ( FROM [JoinOneSelfPayload] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[LeftId] = [e0].[Id] ) AS [s] ON [e].[Id] = [s].[RightId] -ORDER BY [e].[Id], [s].[LeftId], [s].[RightId] +ORDER BY [e].[Id], [s].[LeftId] """); } @@ -634,7 +634,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e3] INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e4] ON [e3].[CompositeKeySkipSharedKey1] = [e4].[Key1] AND [e3].[CompositeKeySkipSharedKey2] = [e4].[Key2] AND [e3].[CompositeKeySkipSharedKey3] = [e4].[Key3] ) AS [s1] ON [e].[Id] = [s1].[TwoSkipSharedId] -ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s].[Id], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s0].[Id], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2] +ORDER BY [e].[Id], [s].[ThreeId], [s].[TwoId], [s0].[SelfSkipSharedLeftId], [s0].[SelfSkipSharedRightId], [s1].[TwoSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2] """); } @@ -672,7 +672,7 @@ LEFT JOIN ( FROM [EntityCompositeKeyEntityRoot] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] ) AS [s] ON [e].[Key1] = [s].[CompositeKeySkipSharedKey1] AND [e].[Key2] = [s].[CompositeKeySkipSharedKey2] AND [e].[Key3] = [s].[CompositeKeySkipSharedKey3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2], [s].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s].[RootSkipSharedId], [s].[CompositeKeySkipSharedKey1], [s].[CompositeKeySkipSharedKey2] """); } @@ -690,7 +690,7 @@ LEFT JOIN ( INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[OneId] = [e0].[Id] LEFT JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[Id] = [e1].[ReferenceInverseId] ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId] """); } @@ -716,7 +716,7 @@ LEFT JOIN ( INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [j0].[EntityOneId] = [e2].[Id] ) AS [s] ON [e1].[Id] = [s].[EntityBranchId] ) AS [s0] ON [e].[Key1] = [s0].[CompositeId1] AND [e].[Key2] = [s0].[CompositeId2] AND [e].[Key3] = [s0].[CompositeId3] -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Id], [s0].[EntityBranchId], [s0].[EntityOneId] +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[EntityBranchId] """); } @@ -739,7 +739,7 @@ LEFT JOIN ( INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [j0].[RightId] = [e2].[Id] ) AS [s] ON [e0].[Id] = [s].[LeftId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[Id0], [s0].[LeftId], [s0].[RightId] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id0], [s0].[LeftId] """); } @@ -757,7 +757,7 @@ LEFT JOIN ( FROM [EntityOneEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] ) AS [s] ON [e].[Id] = [s].[TwoSkipSharedId] -ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId], [s].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [s].[OneSkipSharedId] """); } @@ -779,7 +779,7 @@ LEFT JOIN ( INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [j0].[ThreeId] = [e1].[Id] ) AS [s] ON [e0].[Id] = [s].[OneId] ) AS [s0] ON [e].[Id] = [s0].[ThreeId] -ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[Id], [s0].[OneId0], [s0].[ThreeId0] +ORDER BY [e].[Id], [s0].[OneId], [s0].[ThreeId], [s0].[OneId0] """); } @@ -797,7 +797,7 @@ LEFT JOIN ( INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[OneId] = [e0].[Id] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] +ORDER BY [e].[Id], [s].[OneId] """); } @@ -900,7 +900,7 @@ LEFT JOIN ( WHERE [e2].[Id] < 10 ) AS [s] ON [e1].[Id] = [s].[ThreeId] ) AS [s0] ON [e].[Id] = [s0].[RootSkipSharedId] -ORDER BY [e].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[Id], [s0].[OneId], [s0].[ThreeId] +ORDER BY [e].[Id], [s0].[RootSkipSharedId], [s0].[ThreeSkipSharedId], [s0].[OneId] """); } @@ -926,7 +926,7 @@ LEFT JOIN ( WHERE 1 < [s].[row] AND [s].[row] <= 3 ) AS [s0] ON [e1].[Key1] = [s0].[CompositeId1] AND [e1].[Key2] = [s0].[CompositeId2] AND [e1].[Key3] = [s0].[CompositeId3] ) AS [s1] ON [e].[Id] = [s1].[RootSkipSharedId] -ORDER BY [e].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[Key1], [s1].[Key2], [s1].[Key3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] +ORDER BY [e].[Id], [s1].[RootSkipSharedId], [s1].[CompositeKeySkipSharedKey1], [s1].[CompositeKeySkipSharedKey2], [s1].[CompositeKeySkipSharedKey3], [s1].[CompositeId1], [s1].[CompositeId2], [s1].[CompositeId3], [s1].[Id0] """); } @@ -950,7 +950,7 @@ LEFT JOIN ( WHERE [e0].[Key1] < 5 ) AS [s0] ON [e].[Id] = [s0].[LeafId] WHERE [e].[Discriminator] = N'EntityLeaf' -ORDER BY [e].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[Key1], [s0].[Key2], [s0].[Key3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2], [s0].[CompositeKeySkipSharedKey3] +ORDER BY [e].[Id], [s0].[LeafId], [s0].[CompositeId1], [s0].[CompositeId2], [s0].[CompositeId3], [s0].[TwoSkipSharedId], [s0].[CompositeKeySkipSharedKey1], [s0].[CompositeKeySkipSharedKey2] """); } @@ -979,7 +979,7 @@ LEFT JOIN ( WHERE [e1].[Id] < 10 ) AS [s0] ON [s].[Id] = [s0].[TwoId] ) AS [s1] -ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId], [s1].[TwoId0] +ORDER BY [e].[Id], [s1].[Id], [s1].[OneId], [s1].[TwoId], [s1].[ThreeId] """); } @@ -1006,7 +1006,7 @@ LEFT JOIN ( ) AS [s0] ON [e0].[Id] = [s0].[TwoId] WHERE [e0].[Id] < 10 ) AS [s1] ON [e].[Id] = [s1].[OneId] -ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[Id], [s1].[TwoId0], [s1].[Id0] +ORDER BY [e].[Id], [s1].[OneId], [s1].[TwoId], [s1].[TwoId0], [s1].[Id0] """); } @@ -1026,7 +1026,7 @@ LEFT JOIN ( LEFT JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] < 10 ) AS [s] ON [e].[Id] = [s].[TwoId] -ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id], [s].[Id0] +ORDER BY [e].[Id], [s].[OneId], [s].[TwoId], [s].[Id0] """); } @@ -1063,7 +1063,7 @@ WHERE [e3].[Id] < 20 ) AS [s1] ON [e0].[Id] = [s1].[EntityOneId] WHERE [e0].[Id] < 10 ) AS [s2] ON [e].[Id] = [s2].[ThreeId] -ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[Id], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId], [s2].[EntityOneId] +ORDER BY [e].[Id], [s2].[OneId], [s2].[ThreeId], [s2].[OneId0], [s2].[Id0], [s2].[TwoId], [s2].[EntityBranchId] """); } @@ -1086,7 +1086,7 @@ WHERE [e1].[Id] < 5 ) AS [e2] ON [e0].[Id] = [e2].[CollectionInverseId] WHERE [e0].[Id] > 15 ) AS [s] ON [e].[Id] = [s].[ThreeId] -ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId], [s].[Id] +ORDER BY [e].[Id], [s].[OneId], [s].[ThreeId] """); } @@ -1109,7 +1109,7 @@ WHERE [e1].[Id] < 5 ) AS [s] ON [e0].[Id] = [s].[TwoId] WHERE [e0].[Id] > 15 ) AS [s0] ON [e].[Id] = [s0].[CollectionInverseId] -ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId], [s0].[TwoId] +ORDER BY [e].[Id], [s0].[Id], [s0].[ThreeId] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalOwnedQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalOwnedQuerySqlServerTest.cs index 120b0ecd277..b91e5797b0d 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalOwnedQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalOwnedQuerySqlServerTest.cs @@ -343,7 +343,7 @@ public override async Task Filter_owned_entity_chained_with_regular_entity_follo AssertSql( """ -SELECT [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[PeriodEnd], [s].[PeriodStart], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [s].[PeriodEnd0], [s].[PeriodStart0] +SELECT [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[PeriodEnd], [s].[PeriodStart], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [s].[PeriodEnd0], [s].[PeriodStart0] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN ( @@ -352,7 +352,7 @@ LEFT JOIN ( LEFT JOIN [OrderDetail] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o1] ON [o0].[ClientId] = [o1].[OrderClientId] AND [o0].[Id] = [o1].[OrderId] ) AS [s] ON [o].[Id] = [s].[ClientId] WHERE [p].[Id] <> 42 OR [p].[Id] IS NULL -ORDER BY [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] +ORDER BY [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] """); } @@ -362,7 +362,7 @@ public override async Task Project_multiple_owned_navigations(bool async) AssertSql( """ -SELECT [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[PeriodEnd], [s].[PeriodStart], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [s].[PeriodEnd0], [s].[PeriodStart0], [o].[PersonAddress_AddressLine], [o].[PeriodEnd], [o].[PeriodStart], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [p].[Name], [p].[PeriodEnd], [p].[PeriodStart], [p].[StarId] +SELECT [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[PeriodEnd], [s].[PeriodStart], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [s].[PeriodEnd0], [s].[PeriodStart0], [o].[PersonAddress_AddressLine], [o].[PeriodEnd], [o].[PeriodStart], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [p].[Id], [p].[Name], [p].[PeriodEnd], [p].[PeriodStart], [p].[StarId] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN ( @@ -370,7 +370,7 @@ LEFT JOIN ( FROM [Order] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o0] LEFT JOIN [OrderDetail] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o1] ON [o0].[ClientId] = [o1].[OrderClientId] AND [o0].[Id] = [o1].[OrderId] ) AS [s] ON [o].[Id] = [s].[ClientId] -ORDER BY [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] +ORDER BY [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] """); } @@ -399,7 +399,7 @@ public override async Task Navigation_rewrite_on_owned_reference_followed_by_reg AssertSql( """ -SELECT [o].[Id], [o].[Discriminator], [o].[Name], [o].[PeriodEnd], [o].[PeriodStart], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[PeriodEnd], [s].[PeriodStart], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [s].[PeriodEnd0], [s].[PeriodStart0], [o].[PersonAddress_AddressLine], [o].[PeriodEnd], [o].[PeriodStart], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [o].[BranchAddress_BranchName], [o].[BranchAddress_PlaceType], [o].[BranchAddress_Country_Name], [o].[BranchAddress_Country_PlanetId], [o].[LeafBAddress_LeafBType], [o].[LeafBAddress_PlaceType], [o].[LeafBAddress_Country_Name], [o].[LeafBAddress_Country_PlanetId], [o].[LeafAAddress_LeafType], [o].[LeafAAddress_PlaceType], [o].[LeafAAddress_Country_Name], [o].[LeafAAddress_Country_PlanetId] +SELECT [o].[Id], [o].[Discriminator], [o].[Name], [o].[PeriodEnd], [o].[PeriodStart], [s].[ClientId], [s].[Id], [s].[OrderDate], [s].[PeriodEnd], [s].[PeriodStart], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s].[Detail], [s].[PeriodEnd0], [s].[PeriodStart0], [o].[PersonAddress_AddressLine], [o].[PeriodEnd], [o].[PeriodStart], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [o].[BranchAddress_BranchName], [o].[BranchAddress_PlaceType], [o].[BranchAddress_Country_Name], [o].[BranchAddress_Country_PlanetId], [o].[LeafBAddress_LeafBType], [o].[LeafBAddress_PlaceType], [o].[LeafBAddress_Country_Name], [o].[LeafBAddress_Country_PlanetId], [o].[LeafAAddress_LeafType], [o].[LeafAAddress_PlaceType], [o].[LeafAAddress_Country_Name], [o].[LeafAAddress_Country_PlanetId] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN ( @@ -408,7 +408,7 @@ LEFT JOIN ( LEFT JOIN [OrderDetail] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o1] ON [o0].[ClientId] = [o1].[OrderClientId] AND [o0].[Id] = [o1].[OrderId] ) AS [s] ON [o].[Id] = [s].[ClientId] WHERE [p].[Id] <> 7 OR [p].[Id] IS NULL -ORDER BY [o].[Id], [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] +ORDER BY [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId] """); } @@ -430,11 +430,11 @@ public override async Task Navigation_rewrite_on_owned_reference_followed_by_reg AssertSql( """ -SELECT [o].[Id], [p].[Id], [m].[Id], [m].[Diameter], [m].[PeriodEnd], [m].[PeriodStart], [m].[PlanetId] +SELECT [o].[Id], [m].[Id], [m].[Diameter], [m].[PeriodEnd], [m].[PeriodStart], [m].[PlanetId] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN [Moon] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [m] ON [p].[Id] = [m].[PlanetId] -ORDER BY [o].[Id], [p].[Id] +ORDER BY [o].[Id] """); } @@ -471,12 +471,12 @@ public override async Task Navigation_rewrite_on_owned_reference_followed_by_reg AssertSql( """ -SELECT [s].[Id], [s].[Name], [s].[PeriodEnd], [s].[PeriodStart], [o].[Id], [p].[Id], [e].[Id], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[StarId] +SELECT [s].[Id], [s].[Name], [s].[PeriodEnd], [s].[PeriodStart], [o].[Id], [e].[Id], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[StarId] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN [Star] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [p].[StarId] = [s].[Id] LEFT JOIN [Element] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] ON [s].[Id] = [e].[StarId] -ORDER BY [o].[Id], [p].[Id], [s].[Id] +ORDER BY [o].[Id] """); } @@ -502,13 +502,13 @@ await base.Navigation_rewrite_on_owned_reference_followed_by_regular_entity_and_ AssertSql( """ -SELECT [s].[Id], [s].[Name], [s].[PeriodEnd], [s].[PeriodStart], [o].[Id], [p].[Id], [e].[Id], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[StarId] +SELECT [s].[Id], [s].[Name], [s].[PeriodEnd], [s].[PeriodStart], [o].[Id], [e].[Id], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[StarId] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] LEFT JOIN [Star] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [s] ON [p].[StarId] = [s].[Id] LEFT JOIN [Element] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] ON [s].[Id] = [e].[StarId] WHERE [s].[Name] = N'Sol' -ORDER BY [o].[Id], [p].[Id], [s].[Id] +ORDER BY [o].[Id] """); } @@ -1146,27 +1146,25 @@ public override async Task Project_multiple_owned_navigations_split(bool async) AssertSql( """ -SELECT [o].[Id], [p].[Id], [o].[PersonAddress_AddressLine], [o].[PeriodEnd], [o].[PeriodStart], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [p].[Name], [p].[PeriodEnd], [p].[PeriodStart], [p].[StarId] +SELECT [o].[Id], [o].[PersonAddress_AddressLine], [o].[PeriodEnd], [o].[PeriodStart], [o].[PersonAddress_PlaceType], [o].[PersonAddress_ZipCode], [o].[PersonAddress_Country_Name], [o].[PersonAddress_Country_PlanetId], [p].[Id], [p].[Name], [p].[PeriodEnd], [p].[PeriodStart], [p].[StarId] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] -ORDER BY [o].[Id], [p].[Id] +ORDER BY [o].[Id] """, // """ -SELECT [o1].[ClientId], [o1].[Id], [o1].[OrderDate], [o1].[PeriodEnd], [o1].[PeriodStart], [o].[Id], [p].[Id] +SELECT [o1].[ClientId], [o1].[Id], [o1].[OrderDate], [o1].[PeriodEnd], [o1].[PeriodStart], [o].[Id] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] -LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] INNER JOIN [Order] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o1] ON [o].[Id] = [o1].[ClientId] -ORDER BY [o].[Id], [p].[Id], [o1].[ClientId], [o1].[Id] +ORDER BY [o].[Id], [o1].[ClientId], [o1].[Id] """, // """ -SELECT [o3].[OrderClientId], [o3].[OrderId], [o3].[Id], [o3].[Detail], [o3].[PeriodEnd], [o3].[PeriodStart], [o].[Id], [p].[Id], [o1].[ClientId], [o1].[Id] +SELECT [o3].[OrderClientId], [o3].[OrderId], [o3].[Id], [o3].[Detail], [o3].[PeriodEnd], [o3].[PeriodStart], [o].[Id], [o1].[ClientId], [o1].[Id] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] -LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] INNER JOIN [Order] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o1] ON [o].[Id] = [o1].[ClientId] INNER JOIN [OrderDetail] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o3] ON [o1].[ClientId] = [o3].[OrderClientId] AND [o1].[Id] = [o3].[OrderId] -ORDER BY [o].[Id], [p].[Id], [o1].[ClientId], [o1].[Id] +ORDER BY [o].[Id], [o1].[ClientId], [o1].[Id] """); } @@ -1176,18 +1174,17 @@ public override async Task Navigation_rewrite_on_owned_reference_followed_by_reg AssertSql( """ -SELECT [o].[Id], [p].[Id] +SELECT [o].[Id] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] -LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] -ORDER BY [o].[Id], [p].[Id] +ORDER BY [o].[Id] """, // """ -SELECT [m].[Id], [m].[Diameter], [m].[PeriodEnd], [m].[PeriodStart], [m].[PlanetId], [o].[Id], [p].[Id] +SELECT [m].[Id], [m].[Diameter], [m].[PeriodEnd], [m].[PeriodStart], [m].[PlanetId], [o].[Id] FROM [OwnedPerson] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o] LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [o].[PersonAddress_Country_PlanetId] = [p].[Id] INNER JOIN [Moon] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [m] ON [p].[Id] = [m].[PlanetId] -ORDER BY [o].[Id], [p].[Id] +ORDER BY [o].[Id] """); } @@ -1367,11 +1364,11 @@ public override async Task Projecting_collection_correlated_with_keyless_entity_ AssertSql( """ -SELECT [b].[Throned_Value], [f].[Id], [b].[Id], [p].[Id], [p].[Name], [p].[PeriodEnd], [p].[PeriodStart], [p].[StarId] +SELECT [b].[Throned_Value], [f].[Id], [p].[Id], [p].[Name], [p].[PeriodEnd], [p].[PeriodStart], [p].[StarId] FROM [Fink] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN [Barton] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [b] ON [f].[BartonId] = [b].[Id] LEFT JOIN [Planet] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [p] ON [b].[Throned_Value] <> [p].[Id] OR [b].[Throned_Value] IS NULL -ORDER BY [f].[Id], [b].[Id] +ORDER BY [f].[Id] """); } @@ -1437,7 +1434,7 @@ LEFT JOIN ( FROM [Order] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o2] LEFT JOIN [OrderDetail] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o3] ON [o2].[ClientId] = [o3].[OrderClientId] AND [o2].[Id] = [o3].[OrderId] ) AS [s0] ON [o].[Id] = [s0].[ClientId] -ORDER BY [p].[Id], [o].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s0].[ClientId], [s0].[Id], [s0].[OrderClientId], [s0].[OrderId] +ORDER BY [p].[Id], [s].[ClientId], [s].[Id], [s].[OrderClientId], [s].[OrderId], [s].[Id0], [s0].[ClientId], [s0].[Id], [s0].[OrderClientId], [s0].[OrderId] """); } @@ -1459,7 +1456,7 @@ LEFT JOIN ( FROM [Order] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o0] LEFT JOIN [OrderDetail] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [o1] ON [o0].[ClientId] = [o1].[OrderClientId] AND [o0].[Id] = [o1].[OrderId] ) AS [s0] ON [s].[Id0] = [s0].[ClientId] -ORDER BY [p].[Id], [s].[Id], [s].[Id0], [s0].[ClientId], [s0].[Id], [s0].[OrderClientId], [s0].[OrderId] +ORDER BY [p].[Id], [s].[Id], [s0].[ClientId], [s0].[Id], [s0].[OrderClientId], [s0].[OrderId] """); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/UdfDbFunctionSqlServerTests.cs b/test/EFCore.SqlServer.FunctionalTests/Query/UdfDbFunctionSqlServerTests.cs index 591fdc855db..449bc445e10 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/UdfDbFunctionSqlServerTests.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/UdfDbFunctionSqlServerTests.cs @@ -878,14 +878,14 @@ public override void QF_Correlated_Func_Call_With_Navigation() AssertSql( """ -SELECT [c].[Id], [s].[CustomerName], [s].[OrderId], [s].[Id] +SELECT [c].[Id], [s].[CustomerName], [s].[OrderId] FROM [Customers] AS [c] OUTER APPLY ( - SELECT [c0].[LastName] AS [CustomerName], [g].[OrderId], [c0].[Id] + SELECT [c0].[LastName] AS [CustomerName], [g].[OrderId] FROM [dbo].[GetOrdersWithMultipleProducts]([c].[Id]) AS [g] INNER JOIN [Customers] AS [c0] ON [g].[CustomerId] = [c0].[Id] ) AS [s] -ORDER BY [c].[Id], [s].[OrderId] +ORDER BY [c].[Id] """); } diff --git a/test/EFCore.Sqlite.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqliteTest.cs index a41ee6f5bc7..3993f0623a6 100644 --- a/test/EFCore.Sqlite.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqliteTest.cs @@ -160,7 +160,6 @@ DELETE FROM "Context30572_Principal" AS "c" WHERE "c"."Id" IN ( SELECT "c0"."Id" FROM "Context30572_Principal" AS "c0" - LEFT JOIN "Context30572_Dependent" AS "c1" ON "c0"."DependentId" = "c1"."Id" ) """); } diff --git a/test/EFCore.Sqlite.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqliteTest.cs index cc02a2d8d79..295c1c9b70d 100644 --- a/test/EFCore.Sqlite.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqliteTest.cs @@ -535,20 +535,10 @@ public override async Task Delete_with_LeftJoin(bool async) AssertSql( """ -@p1='100' -@p='0' - DELETE FROM "Order Details" AS "o" WHERE EXISTS ( SELECT 1 FROM "Order Details" AS "o0" - LEFT JOIN ( - SELECT "o2"."OrderID" - FROM "Orders" AS "o2" - WHERE "o2"."OrderID" < 10300 - ORDER BY "o2"."OrderID" - LIMIT @p1 OFFSET @p - ) AS "o1" ON "o0"."OrderID" = "o1"."OrderID" WHERE "o0"."OrderID" < 10276 AND "o0"."OrderID" = "o"."OrderID" AND "o0"."ProductID" = "o"."ProductID") """); } @@ -559,20 +549,10 @@ public override async Task Delete_with_LeftJoin_via_flattened_GroupJoin(bool asy AssertSql( """ -@p1='100' -@p='0' - DELETE FROM "Order Details" AS "o" WHERE EXISTS ( SELECT 1 FROM "Order Details" AS "o0" - LEFT JOIN ( - SELECT "o2"."OrderID" - FROM "Orders" AS "o2" - WHERE "o2"."OrderID" < 10300 - ORDER BY "o2"."OrderID" - LIMIT @p1 OFFSET @p - ) AS "o1" ON "o0"."OrderID" = "o1"."OrderID" WHERE "o0"."OrderID" < 10276 AND "o0"."OrderID" = "o"."OrderID" AND "o0"."ProductID" = "o"."ProductID") """); } diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs index a0d39d7b99d..203b6957128 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs @@ -312,7 +312,7 @@ INNER JOIN ( WHERE "g"."Discriminator" = 'Officer' ) AS "g0" ON "t"."GearSquadId" = "g0"."SquadId" AND "t"."GearNickName" = "g0"."Nickname" LEFT JOIN "Gears" AS "g1" ON "g0"."Nickname" = "g1"."LeaderNickname" AND "g0"."SquadId" = "g1"."LeaderSquadId" -ORDER BY "g0"."HasSoulPatch", "g0"."Nickname" DESC, "t"."Id", "g0"."SquadId", "g1"."Nickname" +ORDER BY "g0"."HasSoulPatch", "g0"."Nickname" DESC, "t"."Id", "g1"."Nickname" """); } @@ -441,7 +441,7 @@ LEFT JOIN ( WHERE "l"."Discriminator" = 'LocustCommander' ) AS "l0" ON "f"."CommanderName" = "l0"."Name" LEFT JOIN "LocustLeaders" AS "l1" ON "f"."Id" = "l1"."LocustHordeId" -ORDER BY "f"."Name", "f"."Id", "l0"."Name" +ORDER BY "f"."Name", "f"."Id" """); } @@ -469,7 +469,7 @@ public override async Task Correlated_collections_deeply_nested_left_join(bool a AssertSql( """ -SELECT "t"."Id", "g"."Nickname", "g"."SquadId", "s"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Id", "s0"."AmmunitionType", "s0"."IsAutomatic", "s0"."Name", "s0"."OwnerFullName", "s0"."SynergyWithId" +SELECT "t"."Id", "g"."Nickname", "g"."SquadId", "s0"."Nickname", "s0"."SquadId", "s0"."Id", "s0"."AmmunitionType", "s0"."IsAutomatic", "s0"."Name", "s0"."OwnerFullName", "s0"."SynergyWithId" FROM "Tags" AS "t" LEFT JOIN "Gears" AS "g" ON "t"."GearNickName" = "g"."Nickname" LEFT JOIN "Squads" AS "s" ON "g"."SquadId" = "s"."Id" @@ -483,7 +483,7 @@ LEFT JOIN ( ) AS "w0" ON "g0"."FullName" = "w0"."OwnerFullName" WHERE "g0"."HasSoulPatch" ) AS "s0" ON "s"."Id" = "s0"."SquadId" -ORDER BY "t"."Note", "g"."Nickname" DESC, "t"."Id", "g"."SquadId", "s"."Id", "s0"."Nickname", "s0"."SquadId" +ORDER BY "t"."Note", "g"."Nickname" DESC, "t"."Id", "g"."SquadId", "s0"."Nickname", "s0"."SquadId" """); } @@ -714,10 +714,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."Id", "s3"."SquadId0", "s3"."MissionId0" +SELECT "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."SquadId0", "s3"."MissionId0" FROM "Squads" AS "s" LEFT JOIN ( - SELECT "s0"."SquadId", "s0"."MissionId", "m"."Id", "s2"."SquadId" AS "SquadId0", "s2"."MissionId" AS "MissionId0" + SELECT "s0"."SquadId", "s0"."MissionId", "s2"."SquadId" AS "SquadId0", "s2"."MissionId" AS "MissionId0" FROM "SquadMissions" AS "s0" INNER JOIN "Missions" AS "m" ON "s0"."MissionId" = "m"."Id" LEFT JOIN ( @@ -727,7 +727,7 @@ LEFT JOIN ( ) AS "s2" ON "m"."Id" = "s2"."MissionId" WHERE "s0"."MissionId" < 3 ) AS "s3" ON "s"."Id" = "s3"."SquadId" -ORDER BY "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."Id", "s3"."SquadId0" +ORDER BY "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."SquadId0" """); } @@ -1114,7 +1114,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "t"."Id", "g1"."Nickname", "g1"."SquadId", "s"."Id", "s"."AmmunitionType", "s"."IsAutomatic", "s"."Name", "s"."OwnerFullName", "s"."SynergyWithId", "s"."Nickname", "s"."SquadId" +SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "t"."Id", "s"."Id", "s"."AmmunitionType", "s"."IsAutomatic", "s"."Name", "s"."OwnerFullName", "s"."SynergyWithId", "s"."Nickname", "s"."SquadId" FROM "Gears" AS "g" LEFT JOIN "Tags" AS "t" ON "g"."Nickname" = "t"."GearNickName" AND "g"."SquadId" = "t"."GearSquadId" LEFT JOIN "Gears" AS "g1" ON "t"."GearNickName" = "g1"."Nickname" AND "t"."GearSquadId" = "g1"."SquadId" @@ -1127,7 +1127,7 @@ LEFT JOIN ( SELECT 1 FROM "Gears" AS "g0" WHERE "g"."Nickname" = "g0"."LeaderNickname" AND "g"."SquadId" = "g0"."LeaderSquadId") -ORDER BY "g"."HasSoulPatch" DESC, "t"."Note", "g"."Nickname", "g"."SquadId", "t"."Id", "g1"."Nickname", "g1"."SquadId", "s"."IsAutomatic", "s"."Nickname" DESC, "s"."Id" +ORDER BY "g"."HasSoulPatch" DESC, "t"."Note", "g"."Nickname", "g"."SquadId", "t"."Id", "s"."IsAutomatic", "s"."Nickname" DESC, "s"."Id" """); } @@ -1303,7 +1303,7 @@ public override async Task Correlated_collections_from_left_join_with_additional AssertSql( """ -SELECT "w"."Id", "g"."Nickname", "g"."SquadId", "s"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Id", "s0"."AmmunitionType", "s0"."IsAutomatic", "s0"."Name", "s0"."OwnerFullName", "s0"."SynergyWithId", "s0"."Rank" +SELECT "w"."Id", "g"."Nickname", "g"."SquadId", "s0"."Nickname", "s0"."SquadId", "s0"."Id", "s0"."AmmunitionType", "s0"."IsAutomatic", "s0"."Name", "s0"."OwnerFullName", "s0"."SynergyWithId", "s0"."Rank" FROM "Weapons" AS "w" LEFT JOIN "Gears" AS "g" ON "w"."OwnerFullName" = "g"."FullName" LEFT JOIN "Squads" AS "s" ON "g"."SquadId" = "s"."Id" @@ -1316,7 +1316,7 @@ LEFT JOIN ( WHERE NOT ("w0"."IsAutomatic") ) AS "w1" ON "g0"."FullName" = "w1"."OwnerFullName" ) AS "s0" ON "s"."Id" = "s0"."SquadId" -ORDER BY "w"."Name", "w"."Id", "g"."Nickname", "g"."SquadId", "s"."Id", "s0"."FullName" DESC, "s0"."Nickname", "s0"."SquadId", "s0"."Id" +ORDER BY "w"."Name", "w"."Id", "g"."Nickname", "g"."SquadId", "s0"."FullName" DESC, "s0"."Nickname", "s0"."SquadId", "s0"."Id" """); } @@ -1400,7 +1400,7 @@ public override async Task Correlated_collection_take(bool async) AssertSql( """ -SELECT "g"."Nickname", "g"."SquadId", "c"."Name", "w1"."Id", "w1"."AmmunitionType", "w1"."IsAutomatic", "w1"."Name", "w1"."OwnerFullName", "w1"."SynergyWithId", "c"."Location", "c"."Nation" +SELECT "g"."Nickname", "g"."SquadId", "w1"."Id", "w1"."AmmunitionType", "w1"."IsAutomatic", "w1"."Name", "w1"."OwnerFullName", "w1"."SynergyWithId", "c"."Name", "c"."Location", "c"."Nation" FROM "Gears" AS "g" INNER JOIN "Cities" AS "c" ON "g"."CityOfBirthName" = "c"."Name" LEFT JOIN ( @@ -1411,7 +1411,7 @@ LEFT JOIN ( ) AS "w0" WHERE "w0"."row" <= 10 ) AS "w1" ON "g"."FullName" = "w1"."OwnerFullName" -ORDER BY "g"."Nickname", "g"."SquadId", "c"."Name" +ORDER BY "g"."Nickname", "g"."SquadId" """); } @@ -1485,14 +1485,14 @@ public override async Task Accessing_reference_navigation_collection_composition AssertSql( """ -SELECT "g"."Nickname", "g"."SquadId", "s"."Id", "s"."IsAutomatic", "s"."Name", "s"."Id0" +SELECT "g"."Nickname", "g"."SquadId", "s"."Id", "s"."IsAutomatic", "s"."Name" FROM "Gears" AS "g" LEFT JOIN ( - SELECT "w"."Id", "w"."IsAutomatic", "w0"."Name", "w0"."Id" AS "Id0", "w"."OwnerFullName" + SELECT "w"."Id", "w"."IsAutomatic", "w0"."Name", "w"."OwnerFullName" FROM "Weapons" AS "w" LEFT JOIN "Weapons" AS "w0" ON "w"."SynergyWithId" = "w0"."Id" ) AS "s" ON "g"."FullName" = "s"."OwnerFullName" -ORDER BY "g"."Nickname", "g"."SquadId", "s"."Id" +ORDER BY "g"."Nickname", "g"."SquadId" """); } @@ -1638,7 +1638,7 @@ public override async Task Project_collection_navigation_with_inheritance1(bool AssertSql( """ -SELECT "f"."Id", "l0"."Name", "f0"."Id", "l1"."Name", "l1"."Discriminator", "l1"."LocustHordeId", "l1"."ThreatLevel", "l1"."ThreatLevelByte", "l1"."ThreatLevelNullableByte", "l1"."DefeatedByNickname", "l1"."DefeatedBySquadId", "l1"."HighCommandId" +SELECT "f"."Id", "f0"."Id", "l1"."Name", "l1"."Discriminator", "l1"."LocustHordeId", "l1"."ThreatLevel", "l1"."ThreatLevelByte", "l1"."ThreatLevelNullableByte", "l1"."DefeatedByNickname", "l1"."DefeatedBySquadId", "l1"."HighCommandId" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name" @@ -1647,7 +1647,7 @@ LEFT JOIN ( ) AS "l0" ON "f"."CommanderName" = "l0"."Name" LEFT JOIN "Factions" AS "f0" ON "l0"."Name" = "f0"."CommanderName" LEFT JOIN "LocustLeaders" AS "l1" ON "f0"."Id" = "l1"."LocustHordeId" -ORDER BY "f"."Id", "l0"."Name", "f0"."Id" +ORDER BY "f"."Id", "f0"."Id" """); } @@ -1753,7 +1753,7 @@ public override async Task Include_with_join_collection2(bool async) FROM "Tags" AS "t" INNER JOIN "Gears" AS "g" ON "t"."GearSquadId" = "g"."SquadId" AND "t"."GearNickName" = "g"."Nickname" LEFT JOIN "Weapons" AS "w" ON "g"."FullName" = "w"."OwnerFullName" -ORDER BY "t"."Id", "g"."Nickname", "g"."SquadId" +ORDER BY "t"."Id" """); } @@ -1969,7 +1969,7 @@ public override async Task Cast_to_derived_followed_by_multiple_includes(bool as LEFT JOIN "Gears" AS "g" ON "l"."DefeatedByNickname" = "g"."Nickname" AND "l"."DefeatedBySquadId" = "g"."SquadId" LEFT JOIN "Weapons" AS "w" ON "g"."FullName" = "w"."OwnerFullName" WHERE instr("l"."Name", 'Queen') > 0 -ORDER BY "l"."Name", "g"."Nickname", "g"."SquadId" +ORDER BY "l"."Name" """); } @@ -2033,7 +2033,7 @@ LEFT JOIN ( ) AS "w1" WHERE "w1"."row" <= 1 ) AS "w2" ON "g"."FullName" = "w2"."OwnerFullName" -ORDER BY "g"."Nickname", "g"."SquadId", "s"."Id" +ORDER BY "g"."Nickname", "g"."SquadId" """); } @@ -2118,7 +2118,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "t"."Id", "g1"."Nickname", "g1"."SquadId", "s"."Id", "s"."AmmunitionType", "s"."IsAutomatic", "s"."Name", "s"."OwnerFullName", "s"."SynergyWithId", "s"."Nickname", "s"."SquadId" +SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "t"."Id", "s"."Id", "s"."AmmunitionType", "s"."IsAutomatic", "s"."Name", "s"."OwnerFullName", "s"."SynergyWithId", "s"."Nickname", "s"."SquadId" FROM "Gears" AS "g" LEFT JOIN "Tags" AS "t" ON "g"."Nickname" = "t"."GearNickName" AND "g"."SquadId" = "t"."GearSquadId" LEFT JOIN "Gears" AS "g1" ON "t"."GearNickName" = "g1"."Nickname" AND "t"."GearSquadId" = "g1"."SquadId" @@ -2131,7 +2131,7 @@ LEFT JOIN ( SELECT 1 FROM "Gears" AS "g0" WHERE "g"."Nickname" = "g0"."LeaderNickname" AND "g"."SquadId" = "g0"."LeaderSquadId") -ORDER BY "g"."HasSoulPatch" DESC, "t"."Note", "g"."Nickname", "g"."SquadId", "t"."Id", "g1"."Nickname", "g1"."SquadId", "s"."IsAutomatic", "s"."Nickname" DESC, "s"."Id" +ORDER BY "g"."HasSoulPatch" DESC, "t"."Note", "g"."Nickname", "g"."SquadId", "t"."Id", "s"."IsAutomatic", "s"."Nickname" DESC, "s"."Id" """); } @@ -2700,7 +2700,7 @@ public override async Task Project_collection_navigation_nested_with_take_compos AssertSql( """ -SELECT "t"."Id", "g"."Nickname", "g"."SquadId", "g2"."Nickname", "g2"."SquadId", "g2"."AssignedCityName", "g2"."CityOfBirthName", "g2"."Discriminator", "g2"."FullName", "g2"."HasSoulPatch", "g2"."LeaderNickname", "g2"."LeaderSquadId", "g2"."Rank" +SELECT "t"."Id", "g2"."Nickname", "g2"."SquadId", "g2"."AssignedCityName", "g2"."CityOfBirthName", "g2"."Discriminator", "g2"."FullName", "g2"."HasSoulPatch", "g2"."LeaderNickname", "g2"."LeaderSquadId", "g2"."Rank" FROM "Tags" AS "t" LEFT JOIN "Gears" AS "g" ON "t"."GearNickName" = "g"."Nickname" AND "t"."GearSquadId" = "g"."SquadId" LEFT JOIN ( @@ -2712,7 +2712,7 @@ LEFT JOIN ( WHERE "g1"."row" <= 50 ) AS "g2" ON ("g"."Nickname" = "g2"."LeaderNickname" OR ("g"."Nickname" IS NULL AND "g2"."LeaderNickname" IS NULL)) AND "g"."SquadId" = "g2"."LeaderSquadId" WHERE "g"."Discriminator" = 'Officer' -ORDER BY "t"."Id", "g"."Nickname", "g"."SquadId", "g2"."Nickname" +ORDER BY "t"."Id", "g2"."Nickname" """); } @@ -3101,7 +3101,7 @@ public override async Task Include_multiple_one_to_one_and_one_to_many(bool asyn FROM "Tags" AS "t" LEFT JOIN "Gears" AS "g" ON "t"."GearNickName" = "g"."Nickname" AND "t"."GearSquadId" = "g"."SquadId" LEFT JOIN "Weapons" AS "w" ON "g"."FullName" = "w"."OwnerFullName" -ORDER BY "t"."Id", "g"."Nickname", "g"."SquadId" +ORDER BY "t"."Id" """); } @@ -3387,16 +3387,16 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "s0"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Id0", "s0"."Nickname0", "s0"."HasSoulPatch", "s0"."SquadId0" +SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "s0"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Nickname0", "s0"."HasSoulPatch", "s0"."SquadId0" FROM "Gears" AS "g" LEFT JOIN ( - SELECT "w"."Id", "g0"."Nickname", "g0"."SquadId", "s"."Id" AS "Id0", "g1"."Nickname" AS "Nickname0", "g1"."HasSoulPatch", "g1"."SquadId" AS "SquadId0", "w"."OwnerFullName" + SELECT "w"."Id", "g0"."Nickname", "g0"."SquadId", "g1"."Nickname" AS "Nickname0", "g1"."HasSoulPatch", "g1"."SquadId" AS "SquadId0", "w"."OwnerFullName" FROM "Weapons" AS "w" LEFT JOIN "Gears" AS "g0" ON "w"."OwnerFullName" = "g0"."FullName" LEFT JOIN "Squads" AS "s" ON "g0"."SquadId" = "s"."Id" LEFT JOIN "Gears" AS "g1" ON "s"."Id" = "g1"."SquadId" ) AS "s0" ON "g"."FullName" = "s0"."OwnerFullName" -ORDER BY "g"."FullName", "g"."Nickname" DESC, "g"."SquadId", "s0"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Id0", "s0"."Nickname0" +ORDER BY "g"."FullName", "g"."Nickname" DESC, "g"."SquadId", "s0"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Nickname0" """); } @@ -3929,7 +3929,7 @@ LEFT JOIN ( FROM "Gears" AS "g0" INNER JOIN "Cities" AS "c" ON "g0"."CityOfBirthName" = "c"."Name" ) AS "s" ON ("g"."Nickname" = "s"."LeaderNickname" OR ("g"."Nickname" IS NULL AND "s"."LeaderNickname" IS NULL)) AND "g"."SquadId" = "s"."LeaderSquadId" -ORDER BY "l"."Name", "g"."Nickname", "g"."SquadId", "s"."Nickname", "s"."SquadId" +ORDER BY "l"."Name", "s"."Nickname" """); } @@ -3965,16 +3965,16 @@ public override async Task Correlated_collections_complex_scenario1(bool async) AssertSql( """ -SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "s0"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Id0", "s0"."Nickname0", "s0"."HasSoulPatch", "s0"."SquadId0" +SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "s0"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Nickname0", "s0"."HasSoulPatch", "s0"."SquadId0" FROM "Gears" AS "g" LEFT JOIN ( - SELECT "w"."Id", "g0"."Nickname", "g0"."SquadId", "s"."Id" AS "Id0", "g1"."Nickname" AS "Nickname0", "g1"."HasSoulPatch", "g1"."SquadId" AS "SquadId0", "w"."OwnerFullName" + SELECT "w"."Id", "g0"."Nickname", "g0"."SquadId", "g1"."Nickname" AS "Nickname0", "g1"."HasSoulPatch", "g1"."SquadId" AS "SquadId0", "w"."OwnerFullName" FROM "Weapons" AS "w" LEFT JOIN "Gears" AS "g0" ON "w"."OwnerFullName" = "g0"."FullName" LEFT JOIN "Squads" AS "s" ON "g0"."SquadId" = "s"."Id" LEFT JOIN "Gears" AS "g1" ON "s"."Id" = "g1"."SquadId" ) AS "s0" ON "g"."FullName" = "s0"."OwnerFullName" -ORDER BY "g"."Nickname", "g"."SquadId", "s0"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Id0", "s0"."Nickname0" +ORDER BY "g"."Nickname", "g"."SquadId", "s0"."Id", "s0"."Nickname", "s0"."SquadId", "s0"."Nickname0" """); } @@ -4456,10 +4456,10 @@ public override async Task Correlated_collections_nested_mixed_streaming_with_bu AssertSql( """ -SELECT "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."Id", "s3"."SquadId0", "s3"."MissionId0" +SELECT "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."SquadId0", "s3"."MissionId0" FROM "Squads" AS "s" LEFT JOIN ( - SELECT "s0"."SquadId", "s0"."MissionId", "m"."Id", "s2"."SquadId" AS "SquadId0", "s2"."MissionId" AS "MissionId0" + SELECT "s0"."SquadId", "s0"."MissionId", "s2"."SquadId" AS "SquadId0", "s2"."MissionId" AS "MissionId0" FROM "SquadMissions" AS "s0" INNER JOIN "Missions" AS "m" ON "s0"."MissionId" = "m"."Id" LEFT JOIN ( @@ -4469,7 +4469,7 @@ LEFT JOIN ( ) AS "s2" ON "m"."Id" = "s2"."MissionId" WHERE "s0"."MissionId" < 42 ) AS "s3" ON "s"."Id" = "s3"."SquadId" -ORDER BY "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."Id", "s3"."SquadId0" +ORDER BY "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."SquadId0" """); } @@ -4826,12 +4826,12 @@ public override async Task Project_collection_navigation_nested_composite_key(bo AssertSql( """ -SELECT "t"."Id", "g"."Nickname", "g"."SquadId", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" +SELECT "t"."Id", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" FROM "Tags" AS "t" LEFT JOIN "Gears" AS "g" ON "t"."GearNickName" = "g"."Nickname" AND "t"."GearSquadId" = "g"."SquadId" LEFT JOIN "Gears" AS "g0" ON ("g"."Nickname" = "g0"."LeaderNickname" OR ("g"."Nickname" IS NULL AND "g0"."LeaderNickname" IS NULL)) AND "g"."SquadId" = "g0"."LeaderSquadId" WHERE "g"."Discriminator" = 'Officer' -ORDER BY "t"."Id", "g"."Nickname", "g"."SquadId", "g0"."Nickname" +ORDER BY "t"."Id", "g0"."Nickname" """); } @@ -4975,7 +4975,7 @@ public override async Task Include_multiple_circular_with_filter(bool async) INNER JOIN "Cities" AS "c" ON "g"."CityOfBirthName" = "c"."Name" LEFT JOIN "Gears" AS "g0" ON "c"."Name" = "g0"."AssignedCityName" WHERE "g"."Nickname" = 'Marcus' -ORDER BY "g"."Nickname", "g"."SquadId", "c"."Name", "g0"."Nickname" +ORDER BY "g"."Nickname", "g"."SquadId", "g0"."Nickname" """); } @@ -5053,7 +5053,7 @@ INNER JOIN ( WHERE "g"."Discriminator" = 'Officer' ) AS "g0" ON "t"."GearSquadId" = "g0"."SquadId" AND "t"."GearNickName" = "g0"."Nickname" LEFT JOIN "Gears" AS "g1" ON "g0"."Nickname" = "g1"."LeaderNickname" AND "g0"."SquadId" = "g1"."LeaderSquadId" -ORDER BY "t"."Id", "g0"."Nickname", "g0"."SquadId", "g1"."Nickname" +ORDER BY "t"."Id", "g1"."Nickname" """); } @@ -5092,11 +5092,6 @@ public override async Task Where_subquery_left_join_firstordefault_boolean(bool WHERE "g"."HasSoulPatch" AND ( SELECT "w"."IsAutomatic" FROM "Weapons" AS "w" - LEFT JOIN ( - SELECT "w0"."Id" - FROM "Weapons" AS "w0" - WHERE "g"."FullName" = "w0"."OwnerFullName" - ) AS "w1" ON "w"."Id" = "w1"."Id" WHERE "g"."FullName" = "w"."OwnerFullName" ORDER BY "w"."Id" LIMIT 1) @@ -5337,7 +5332,7 @@ LEFT JOIN ( INNER JOIN "Squads" AS "s" ON "g0"."SquadId" = "s"."Id" LEFT JOIN "SquadMissions" AS "s0" ON "s"."Id" = "s0"."SquadId" ) AS "s1" ON "g"."Nickname" = "s1"."LeaderNickname" AND "g"."SquadId" = "s1"."LeaderSquadId" -ORDER BY "g"."Nickname", "g"."SquadId", "s1"."Nickname", "s1"."SquadId", "s1"."Id", "s1"."SquadId0" +ORDER BY "g"."Nickname", "g"."SquadId", "s1"."Nickname", "s1"."SquadId", "s1"."SquadId0" """); } @@ -5664,7 +5659,7 @@ public override async Task Include_multiple_circular(bool async) FROM "Gears" AS "g" INNER JOIN "Cities" AS "c" ON "g"."CityOfBirthName" = "c"."Name" LEFT JOIN "Gears" AS "g0" ON "c"."Name" = "g0"."AssignedCityName" -ORDER BY "g"."Nickname", "g"."SquadId", "c"."Name", "g0"."Nickname" +ORDER BY "g"."Nickname", "g"."SquadId", "g0"."Nickname" """); } @@ -5887,7 +5882,7 @@ public override async Task Select_correlated_filtered_collection(bool async) AssertSql( """ -SELECT "g"."Nickname", "g"."SquadId", "c"."Name", "w0"."Id", "w0"."AmmunitionType", "w0"."IsAutomatic", "w0"."Name", "w0"."OwnerFullName", "w0"."SynergyWithId" +SELECT "g"."Nickname", "g"."SquadId", "w0"."Id", "w0"."AmmunitionType", "w0"."IsAutomatic", "w0"."Name", "w0"."OwnerFullName", "w0"."SynergyWithId" FROM "Gears" AS "g" INNER JOIN "Cities" AS "c" ON "g"."CityOfBirthName" = "c"."Name" LEFT JOIN ( @@ -5896,7 +5891,7 @@ LEFT JOIN ( WHERE "w"."Name" <> 'Lancer' OR "w"."Name" IS NULL ) AS "w0" ON "g"."FullName" = "w0"."OwnerFullName" WHERE "c"."Name" IN ('Ephyra', 'Hanover') -ORDER BY "g"."Nickname", "g"."SquadId", "c"."Name" +ORDER BY "g"."Nickname", "g"."SquadId" """); } @@ -5907,7 +5902,7 @@ public override async Task Multiple_orderby_with_navigation_expansion_on_one_of_ AssertSql( """ -SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "t"."Id", "g1"."Nickname", "g1"."SquadId", "s"."Id", "s"."AmmunitionType", "s"."IsAutomatic", "s"."Name", "s"."OwnerFullName", "s"."SynergyWithId", "s"."Nickname", "s"."SquadId" +SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "t"."Id", "s"."Id", "s"."AmmunitionType", "s"."IsAutomatic", "s"."Name", "s"."OwnerFullName", "s"."SynergyWithId", "s"."Nickname", "s"."SquadId" FROM "Gears" AS "g" LEFT JOIN "Tags" AS "t" ON "g"."Nickname" = "t"."GearNickName" AND "g"."SquadId" = "t"."GearSquadId" LEFT JOIN "Gears" AS "g1" ON "t"."GearNickName" = "g1"."Nickname" AND "t"."GearSquadId" = "g1"."SquadId" @@ -5923,7 +5918,7 @@ SELECT COUNT(*) SELECT 1 FROM "Gears" AS "g0" WHERE "g"."Nickname" = "g0"."LeaderNickname" AND "g"."SquadId" = "g0"."LeaderSquadId") -ORDER BY "g"."HasSoulPatch" DESC, "t"."Note", "g"."Nickname", "g"."SquadId", "t"."Id", "g1"."Nickname", "g1"."SquadId", "s"."Id" DESC, "s"."c", "s"."Nickname" +ORDER BY "g"."HasSoulPatch" DESC, "t"."Note", "g"."Nickname", "g"."SquadId", "t"."Id", "s"."Id" DESC, "s"."c", "s"."Nickname" """); } @@ -5945,10 +5940,10 @@ public override async Task Correlated_collections_nested(bool async) AssertSql( """ -SELECT "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."Id", "s3"."SquadId0", "s3"."MissionId0" +SELECT "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."SquadId0", "s3"."MissionId0" FROM "Squads" AS "s" LEFT JOIN ( - SELECT "s0"."SquadId", "s0"."MissionId", "m"."Id", "s2"."SquadId" AS "SquadId0", "s2"."MissionId" AS "MissionId0" + SELECT "s0"."SquadId", "s0"."MissionId", "s2"."SquadId" AS "SquadId0", "s2"."MissionId" AS "MissionId0" FROM "SquadMissions" AS "s0" INNER JOIN "Missions" AS "m" ON "s0"."MissionId" = "m"."Id" LEFT JOIN ( @@ -5958,7 +5953,7 @@ LEFT JOIN ( ) AS "s2" ON "m"."Id" = "s2"."MissionId" WHERE "s0"."MissionId" < 42 ) AS "s3" ON "s"."Id" = "s3"."SquadId" -ORDER BY "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."Id", "s3"."SquadId0" +ORDER BY "s"."Id", "s3"."SquadId", "s3"."MissionId", "s3"."SquadId0" """); } @@ -6008,7 +6003,7 @@ LEFT JOIN ( FROM "LocustLeaders" AS "l" LEFT JOIN "Gears" AS "g" ON "l"."DefeatedByNickname" = "g"."Nickname" AND "l"."DefeatedBySquadId" = "g"."SquadId" ) AS "s" ON "f"."Id" = "s"."LocustHordeId" -ORDER BY "f"."Id", "s"."Name", "s"."Nickname" +ORDER BY "f"."Id" """); } @@ -6018,7 +6013,7 @@ public override async Task Accessing_property_of_optional_navigation_in_child_pr AssertSql( """ -SELECT "g"."Nickname" IS NOT NULL AND "g"."SquadId" IS NOT NULL, "t"."Id", "g"."Nickname", "g"."SquadId", "s"."Nickname", "s"."Id", "s"."SquadId" +SELECT "g"."Nickname" IS NOT NULL AND "g"."SquadId" IS NOT NULL, "t"."Id", "s"."Nickname", "s"."Id", "s"."SquadId" FROM "Tags" AS "t" LEFT JOIN "Gears" AS "g" ON "t"."GearNickName" = "g"."Nickname" AND "t"."GearSquadId" = "g"."SquadId" LEFT JOIN ( @@ -6026,7 +6021,7 @@ LEFT JOIN ( FROM "Weapons" AS "w" LEFT JOIN "Gears" AS "g0" ON "w"."OwnerFullName" = "g0"."FullName" ) AS "s" ON "g"."FullName" = "s"."OwnerFullName" -ORDER BY "t"."Note", "t"."Id", "g"."Nickname", "g"."SquadId", "s"."Id", "s"."Nickname" +ORDER BY "t"."Note", "t"."Id", "s"."Id", "s"."Nickname" """); } @@ -6045,7 +6040,7 @@ LEFT JOIN ( ) AS "l0" ON "f"."CommanderName" = "l0"."Name" LEFT JOIN "Gears" AS "g" ON "l0"."DefeatedByNickname" = "g"."Nickname" AND "l0"."DefeatedBySquadId" = "g"."SquadId" LEFT JOIN "Gears" AS "g0" ON ("g"."Nickname" = "g0"."LeaderNickname" OR ("g"."Nickname" IS NULL AND "g0"."LeaderNickname" IS NULL)) AND "g"."SquadId" = "g0"."LeaderSquadId" -ORDER BY "f"."Id", "l0"."Name", "g"."Nickname", "g"."SquadId", "g0"."Nickname" +ORDER BY "f"."Id", "g0"."Nickname" """); } @@ -6104,15 +6099,15 @@ public override async Task Correlated_collections_multiple_nested_complex_collec AssertSql( """ -SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "t"."Id", "g1"."Nickname", "g1"."SquadId", "s1"."FullName", "s1"."Nickname", "s1"."SquadId", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Id0", "s1"."Name", "s1"."IsAutomatic", "s1"."Id1", "s1"."Nickname00", "s1"."HasSoulPatch", "s1"."SquadId00", "s2"."Id", "s2"."AmmunitionType", "s2"."IsAutomatic", "s2"."Name", "s2"."OwnerFullName", "s2"."SynergyWithId", "s2"."Nickname", "s2"."SquadId" +SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "t"."Id", "s1"."FullName", "s1"."Nickname", "s1"."SquadId", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Name", "s1"."IsAutomatic", "s1"."Id0", "s1"."Nickname00", "s1"."HasSoulPatch", "s1"."SquadId00", "s2"."Id", "s2"."AmmunitionType", "s2"."IsAutomatic", "s2"."Name", "s2"."OwnerFullName", "s2"."SynergyWithId", "s2"."Nickname", "s2"."SquadId" FROM "Gears" AS "g" LEFT JOIN "Tags" AS "t" ON "g"."Nickname" = "t"."GearNickName" AND "g"."SquadId" = "t"."GearSquadId" LEFT JOIN "Gears" AS "g1" ON "t"."GearNickName" = "g1"."Nickname" AND "t"."GearSquadId" = "g1"."SquadId" LEFT JOIN ( - SELECT "g2"."FullName", "g2"."Nickname", "g2"."SquadId", "s0"."Id", "s0"."Nickname" AS "Nickname0", "s0"."SquadId" AS "SquadId0", "s0"."Id0", "s0"."Name", "s0"."IsAutomatic", "s0"."Id1", "s0"."Nickname0" AS "Nickname00", "s0"."HasSoulPatch", "s0"."SquadId0" AS "SquadId00", "g2"."Rank", "s0"."IsAutomatic0", "g2"."LeaderNickname", "g2"."LeaderSquadId" + SELECT "g2"."FullName", "g2"."Nickname", "g2"."SquadId", "s0"."Id", "s0"."Nickname" AS "Nickname0", "s0"."SquadId" AS "SquadId0", "s0"."Name", "s0"."IsAutomatic", "s0"."Id0", "s0"."Nickname0" AS "Nickname00", "s0"."HasSoulPatch", "s0"."SquadId0" AS "SquadId00", "g2"."Rank", "s0"."IsAutomatic0", "g2"."LeaderNickname", "g2"."LeaderSquadId" FROM "Gears" AS "g2" LEFT JOIN ( - SELECT "w"."Id", "g3"."Nickname", "g3"."SquadId", "s"."Id" AS "Id0", "w0"."Name", "w0"."IsAutomatic", "w0"."Id" AS "Id1", "g4"."Nickname" AS "Nickname0", "g4"."HasSoulPatch", "g4"."SquadId" AS "SquadId0", "w"."IsAutomatic" AS "IsAutomatic0", "w"."OwnerFullName" + SELECT "w"."Id", "g3"."Nickname", "g3"."SquadId", "w0"."Name", "w0"."IsAutomatic", "w0"."Id" AS "Id0", "g4"."Nickname" AS "Nickname0", "g4"."HasSoulPatch", "g4"."SquadId" AS "SquadId0", "w"."IsAutomatic" AS "IsAutomatic0", "w"."OwnerFullName" FROM "Weapons" AS "w" LEFT JOIN "Gears" AS "g3" ON "w"."OwnerFullName" = "g3"."FullName" LEFT JOIN "Squads" AS "s" ON "g3"."SquadId" = "s"."Id" @@ -6131,7 +6126,7 @@ LEFT JOIN ( SELECT 1 FROM "Gears" AS "g0" WHERE "g"."Nickname" = "g0"."LeaderNickname" AND "g"."SquadId" = "g0"."LeaderSquadId") -ORDER BY "g"."HasSoulPatch" DESC, "t"."Note", "g"."Nickname", "g"."SquadId", "t"."Id", "g1"."Nickname", "g1"."SquadId", "s1"."Rank", "s1"."Nickname", "s1"."SquadId", "s1"."IsAutomatic0", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Id0", "s1"."Id1", "s1"."Nickname00", "s1"."SquadId00", "s2"."IsAutomatic", "s2"."Nickname" DESC, "s2"."Id" +ORDER BY "g"."HasSoulPatch" DESC, "t"."Note", "g"."Nickname", "g"."SquadId", "t"."Id", "s1"."Rank", "s1"."Nickname", "s1"."SquadId", "s1"."IsAutomatic0", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Id0", "s1"."Nickname00", "s1"."SquadId00", "s2"."IsAutomatic", "s2"."Nickname" DESC, "s2"."Id" """); } @@ -6239,7 +6234,7 @@ ORDER BY "t"."Note" LIMIT @p ) AS "s" LEFT JOIN "Weapons" AS "w" ON "s"."FullName" = "w"."OwnerFullName" -ORDER BY "s"."Note", "s"."Name", "s"."Nickname", "s"."SquadId", "s"."Id" +ORDER BY "s"."Note", "s"."Name", "s"."Id" """); } @@ -6571,13 +6566,13 @@ public override async Task Correlated_collections_complex_scenario2(bool async) AssertSql( """ -SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "s1"."FullName", "s1"."Nickname", "s1"."SquadId", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Id0", "s1"."Nickname00", "s1"."HasSoulPatch", "s1"."SquadId00" +SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "s1"."FullName", "s1"."Nickname", "s1"."SquadId", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Nickname00", "s1"."HasSoulPatch", "s1"."SquadId00" FROM "Gears" AS "g" LEFT JOIN ( - SELECT "g0"."FullName", "g0"."Nickname", "g0"."SquadId", "s0"."Id", "s0"."Nickname" AS "Nickname0", "s0"."SquadId" AS "SquadId0", "s0"."Id0", "s0"."Nickname0" AS "Nickname00", "s0"."HasSoulPatch", "s0"."SquadId0" AS "SquadId00", "g0"."LeaderNickname", "g0"."LeaderSquadId" + SELECT "g0"."FullName", "g0"."Nickname", "g0"."SquadId", "s0"."Id", "s0"."Nickname" AS "Nickname0", "s0"."SquadId" AS "SquadId0", "s0"."Nickname0" AS "Nickname00", "s0"."HasSoulPatch", "s0"."SquadId0" AS "SquadId00", "g0"."LeaderNickname", "g0"."LeaderSquadId" FROM "Gears" AS "g0" LEFT JOIN ( - SELECT "w"."Id", "g1"."Nickname", "g1"."SquadId", "s"."Id" AS "Id0", "g2"."Nickname" AS "Nickname0", "g2"."HasSoulPatch", "g2"."SquadId" AS "SquadId0", "w"."OwnerFullName" + SELECT "w"."Id", "g1"."Nickname", "g1"."SquadId", "g2"."Nickname" AS "Nickname0", "g2"."HasSoulPatch", "g2"."SquadId" AS "SquadId0", "w"."OwnerFullName" FROM "Weapons" AS "w" LEFT JOIN "Gears" AS "g1" ON "w"."OwnerFullName" = "g1"."FullName" LEFT JOIN "Squads" AS "s" ON "g1"."SquadId" = "s"."Id" @@ -6585,7 +6580,7 @@ LEFT JOIN ( ) AS "s0" ON "g0"."FullName" = "s0"."OwnerFullName" ) AS "s1" ON "g"."Nickname" = "s1"."LeaderNickname" AND "g"."SquadId" = "s1"."LeaderSquadId" WHERE "g"."Discriminator" = 'Officer' -ORDER BY "g"."Nickname", "g"."SquadId", "s1"."Nickname", "s1"."SquadId", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Id0", "s1"."Nickname00" +ORDER BY "g"."Nickname", "g"."SquadId", "s1"."Nickname", "s1"."SquadId", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Nickname00" """); } @@ -6666,7 +6661,7 @@ public override async Task Include_with_join_multi_level(bool async) INNER JOIN "Tags" AS "t" ON "g"."SquadId" = "t"."GearSquadId" AND "g"."Nickname" = "t"."GearNickName" INNER JOIN "Cities" AS "c" ON "g"."CityOfBirthName" = "c"."Name" LEFT JOIN "Gears" AS "g0" ON "c"."Name" = "g0"."AssignedCityName" -ORDER BY "g"."Nickname", "g"."SquadId", "t"."Id", "c"."Name", "g0"."Nickname" +ORDER BY "g"."Nickname", "g"."SquadId", "t"."Id", "g0"."Nickname" """); } @@ -6746,7 +6741,7 @@ LEFT JOIN ( ) AS "l0" ON "f"."CommanderName" = "l0"."Name" LEFT JOIN "Gears" AS "g" ON "l0"."DefeatedByNickname" = "g"."Nickname" AND "l0"."DefeatedBySquadId" = "g"."SquadId" LEFT JOIN "Gears" AS "g0" ON ("g"."Nickname" = "g0"."LeaderNickname" OR ("g"."Nickname" IS NULL AND "g0"."LeaderNickname" IS NULL)) AND "g"."SquadId" = "g0"."LeaderSquadId" -ORDER BY "f"."Id", "l0"."Name", "g"."Nickname", "g"."SquadId", "g0"."Nickname" +ORDER BY "f"."Id", "g0"."Nickname" """); } @@ -6874,7 +6869,7 @@ GROUP BY "g"."Rank" LEFT JOIN ( SELECT "s"."Nickname", "s"."SquadId", "s"."AssignedCityName", "s"."CityOfBirthName", "s"."Discriminator", "s"."FullName", "s"."HasSoulPatch", "s"."LeaderNickname", "s"."LeaderSquadId", "s"."Rank", "s"."Name", "s"."Location", "s"."Nation" FROM ( - SELECT "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank", "c"."Name", "c"."Location", "c"."Nation", ROW_NUMBER() OVER(PARTITION BY "g0"."Rank" ORDER BY "g0"."Nickname", "g0"."SquadId", "c"."Name") AS "row" + SELECT "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank", "c"."Name", "c"."Location", "c"."Nation", ROW_NUMBER() OVER(PARTITION BY "g0"."Rank" ORDER BY "g0"."Nickname", "g0"."SquadId") AS "row" FROM "Gears" AS "g0" INNER JOIN "Cities" AS "c" ON "g0"."CityOfBirthName" = "c"."Name" WHERE "g0"."HasSoulPatch" @@ -7075,13 +7070,13 @@ public override async Task Correlated_collections_with_funky_orderby_complex_sce AssertSql( """ -SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "s1"."FullName", "s1"."Nickname", "s1"."SquadId", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Id0", "s1"."Nickname00", "s1"."HasSoulPatch", "s1"."SquadId00" +SELECT "g"."FullName", "g"."Nickname", "g"."SquadId", "s1"."FullName", "s1"."Nickname", "s1"."SquadId", "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Nickname00", "s1"."HasSoulPatch", "s1"."SquadId00" FROM "Gears" AS "g" LEFT JOIN ( - SELECT "g0"."FullName", "g0"."Nickname", "g0"."SquadId", "s0"."Id", "s0"."Nickname" AS "Nickname0", "s0"."SquadId" AS "SquadId0", "s0"."Id0", "s0"."Nickname0" AS "Nickname00", "s0"."HasSoulPatch", "s0"."SquadId0" AS "SquadId00", "g0"."HasSoulPatch" AS "HasSoulPatch0", "s0"."IsAutomatic", "s0"."Name", "g0"."LeaderNickname", "g0"."LeaderSquadId" + SELECT "g0"."FullName", "g0"."Nickname", "g0"."SquadId", "s0"."Id", "s0"."Nickname" AS "Nickname0", "s0"."SquadId" AS "SquadId0", "s0"."Nickname0" AS "Nickname00", "s0"."HasSoulPatch", "s0"."SquadId0" AS "SquadId00", "g0"."HasSoulPatch" AS "HasSoulPatch0", "s0"."IsAutomatic", "s0"."Name", "g0"."LeaderNickname", "g0"."LeaderSquadId" FROM "Gears" AS "g0" LEFT JOIN ( - SELECT "w"."Id", "g1"."Nickname", "g1"."SquadId", "s"."Id" AS "Id0", "g2"."Nickname" AS "Nickname0", "g2"."HasSoulPatch", "g2"."SquadId" AS "SquadId0", "w"."IsAutomatic", "w"."Name", "w"."OwnerFullName" + SELECT "w"."Id", "g1"."Nickname", "g1"."SquadId", "g2"."Nickname" AS "Nickname0", "g2"."HasSoulPatch", "g2"."SquadId" AS "SquadId0", "w"."IsAutomatic", "w"."Name", "w"."OwnerFullName" FROM "Weapons" AS "w" LEFT JOIN "Gears" AS "g1" ON "w"."OwnerFullName" = "g1"."FullName" LEFT JOIN "Squads" AS "s" ON "g1"."SquadId" = "s"."Id" @@ -7089,7 +7084,7 @@ LEFT JOIN ( ) AS "s0" ON "g0"."FullName" = "s0"."OwnerFullName" ) AS "s1" ON "g"."Nickname" = "s1"."LeaderNickname" AND "g"."SquadId" = "s1"."LeaderSquadId" WHERE "g"."Discriminator" = 'Officer' -ORDER BY "g"."HasSoulPatch", "g"."LeaderNickname", "g"."FullName", "g"."Nickname", "g"."SquadId", "s1"."FullName", "s1"."HasSoulPatch0" DESC, "s1"."Nickname", "s1"."SquadId", "s1"."IsAutomatic", "s1"."Name" DESC, "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Id0", "s1"."Nickname00" +ORDER BY "g"."HasSoulPatch", "g"."LeaderNickname", "g"."FullName", "g"."Nickname", "g"."SquadId", "s1"."FullName", "s1"."HasSoulPatch0" DESC, "s1"."Nickname", "s1"."SquadId", "s1"."IsAutomatic", "s1"."Name" DESC, "s1"."Id", "s1"."Nickname0", "s1"."SquadId0", "s1"."Nickname00" """); } @@ -7209,7 +7204,7 @@ public override async Task Correlated_collections_projection_of_collection_thru_ AssertSql( """ -SELECT "g"."Nickname", "g"."SquadId", "s"."Id", "s1"."SquadId", "s1"."MissionId" +SELECT "g"."Nickname", "g"."SquadId", "s1"."SquadId", "s1"."MissionId" FROM "Gears" AS "g" INNER JOIN "Squads" AS "s" ON "g"."SquadId" = "s"."Id" LEFT JOIN ( @@ -7218,7 +7213,7 @@ LEFT JOIN ( WHERE "s0"."MissionId" <> 17 ) AS "s1" ON "s"."Id" = "s1"."SquadId" WHERE "g"."Nickname" <> 'Marcus' -ORDER BY "g"."FullName", "g"."Nickname", "g"."SquadId", "s"."Id", "s1"."SquadId" +ORDER BY "g"."FullName", "g"."Nickname", "g"."SquadId", "s1"."SquadId" """); } @@ -7456,7 +7451,7 @@ public override async Task ThenInclude_collection_on_derived_after_base_referenc FROM "Tags" AS "t" LEFT JOIN "Gears" AS "g" ON "t"."GearNickName" = "g"."Nickname" AND "t"."GearSquadId" = "g"."SquadId" LEFT JOIN "Weapons" AS "w" ON "g"."FullName" = "w"."OwnerFullName" -ORDER BY "t"."Id", "g"."Nickname", "g"."SquadId" +ORDER BY "t"."Id" """); } @@ -7466,7 +7461,7 @@ public override async Task Project_collection_navigation_with_inheritance2(bool AssertSql( """ -SELECT "f"."Id", "l0"."Name", "g"."Nickname", "g"."SquadId", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" +SELECT "f"."Id", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name", "l"."DefeatedByNickname", "l"."DefeatedBySquadId" @@ -7475,7 +7470,7 @@ LEFT JOIN ( ) AS "l0" ON "f"."CommanderName" = "l0"."Name" LEFT JOIN "Gears" AS "g" ON "l0"."DefeatedByNickname" = "g"."Nickname" AND "l0"."DefeatedBySquadId" = "g"."SquadId" LEFT JOIN "Gears" AS "g0" ON ("g"."Nickname" = "g0"."LeaderNickname" OR ("g"."Nickname" IS NULL AND "g0"."LeaderNickname" IS NULL)) AND "g"."SquadId" = "g0"."LeaderSquadId" -ORDER BY "f"."Id", "l0"."Name", "g"."Nickname", "g"."SquadId", "g0"."Nickname" +ORDER BY "f"."Id", "g0"."Nickname" """); } @@ -7587,7 +7582,7 @@ public override async Task Project_collection_navigation_with_inheritance3(bool AssertSql( """ -SELECT "f"."Id", "l0"."Name", "g"."Nickname", "g"."SquadId", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" +SELECT "f"."Id", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name", "l"."DefeatedByNickname", "l"."DefeatedBySquadId" @@ -7596,7 +7591,7 @@ LEFT JOIN ( ) AS "l0" ON "f"."CommanderName" = "l0"."Name" LEFT JOIN "Gears" AS "g" ON "l0"."DefeatedByNickname" = "g"."Nickname" AND "l0"."DefeatedBySquadId" = "g"."SquadId" LEFT JOIN "Gears" AS "g0" ON ("g"."Nickname" = "g0"."LeaderNickname" OR ("g"."Nickname" IS NULL AND "g0"."LeaderNickname" IS NULL)) AND "g"."SquadId" = "g0"."LeaderSquadId" -ORDER BY "f"."Id", "l0"."Name", "g"."Nickname", "g"."SquadId", "g0"."Nickname" +ORDER BY "f"."Id", "g0"."Nickname" """); }