You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e6908ad
Browse filesBrowse the repository at this point in the historyBrowse files
Fix null checks and primitive collections of JSON members over single-result subqueries
Comparing a JSON owned navigation of an entity returned by a single-result
subquery to null checked the values in the document, so a document whose
values are all null was treated as absent. Check the document itself over
the subquery instead.
Querying a primitive collection of a JSON complex type on such an entity
threw while generating the table alias, since the scalar subquery's
projection has no alias. Derive the alias from the projected JSON property
instead.
Copy file name to clipboardExpand all lines: test/EFCore.Cosmos.FunctionalTests/Query/Associations/ComplexProperties/ComplexPropertiesPrimitiveCollectionCosmosTest.cs
Copy file name to clipboardExpand all lines: test/EFCore.Specification.Tests/Query/Associations/ComplexProperties/ComplexPropertiesPrimitiveCollectionTestBase.cs
Copy file name to clipboardExpand all lines: test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonPrimitiveCollectionSqlServerTest.cs
+79Lines changed: 79 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,85 @@ FROM OPENJSON(JSON_QUERY([r].[RequiredAssociate], '$.Ints')) WITH ([value] int '
SELECT [r4].[Id], [r4].[RequiredAssociate] AS [c1], [r4].[Id] % 2 AS [Key]
151
+
FROM [RootEntity] AS [r4]
152
+
) AS [r3]
153
+
WHERE ([r0].[Key] = [r3].[Key] OR ([r0].[Key] IS NULL AND [r3].[Key] IS NULL)) AND [r3].[Id] > 0
154
+
ORDER BY [r3].[Id]), 2) = 1
155
+
) AS [r5]
156
+
LEFT JOIN (
157
+
SELECT [r6].[Id], [r6].[Name], [r6].[c] AS [c], [r6].[c0] AS [c0], [r6].[c1] AS [c1], [r6].[Key]
158
+
FROM (
159
+
SELECT [r1].[Id], [r1].[Name], [r1].[c] AS [c], [r1].[c0] AS [c0], [r1].[c1] AS [c1], [r1].[Key], ROW_NUMBER() OVER(PARTITION BY [r1].[Key] ORDER BY [r1].[Id]) AS [row]
160
+
FROM (
161
+
SELECT [r2].[Id], [r2].[Name], [r2].[AssociateCollection] AS [c], [r2].[OptionalAssociate] AS [c0], [r2].[RequiredAssociate] AS [c1], [r2].[Id] % 2 AS [Key]
162
+
FROM [RootEntity] AS [r2]
163
+
) AS [r1]
164
+
WHERE [r1].[Id] > 0
165
+
) AS [r6]
166
+
WHERE [r6].[row] <= 1
167
+
) AS [r7] ON [r5].[Key] = [r7].[Key] OR ([r5].[Key] IS NULL AND [r7].[Key] IS NULL)
SELECT [r4].[Id], [r4].[RequiredAssociate] AS [c1], [r4].[Id] % 2 AS [Key]
188
+
FROM [RootEntity] AS [r4]
189
+
) AS [r3]
190
+
WHERE ([r0].[Key] = [r3].[Key] OR ([r0].[Key] IS NULL AND [r3].[Key] IS NULL)) AND [r3].[Id] > 0
191
+
ORDER BY [r3].[Id])) WITH ([value] int '$') AS [i]
192
+
)
193
+
) AS [r5]
194
+
LEFT JOIN (
195
+
SELECT [r6].[Id], [r6].[Name], [r6].[c] AS [c], [r6].[c0] AS [c0], [r6].[c1] AS [c1], [r6].[Key]
196
+
FROM (
197
+
SELECT [r1].[Id], [r1].[Name], [r1].[c] AS [c], [r1].[c0] AS [c0], [r1].[c1] AS [c1], [r1].[Key], ROW_NUMBER() OVER(PARTITION BY [r1].[Key] ORDER BY [r1].[Id]) AS [row]
198
+
FROM (
199
+
SELECT [r2].[Id], [r2].[Name], [r2].[AssociateCollection] AS [c], [r2].[OptionalAssociate] AS [c0], [r2].[RequiredAssociate] AS [c1], [r2].[Id] % 2 AS [Key]
200
+
FROM [RootEntity] AS [r2]
201
+
) AS [r1]
202
+
WHERE [r1].[Id] > 0
203
+
) AS [r6]
204
+
WHERE [r6].[row] <= 1
205
+
) AS [r7] ON [r5].[Key] = [r7].[Key] OR ([r5].[Key] IS NULL AND [r7].[Key] IS NULL)
0 commit comments