Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<EFCoreVersion>10.0.4</EFCoreVersion>
<MicrosoftExtensionsVersion>10.0.4</MicrosoftExtensionsVersion>
<EFCoreVersion>10.0.13</EFCoreVersion>
<MicrosoftExtensionsVersion>10.0.13</MicrosoftExtensionsVersion>
<NpgsqlVersion>10.0.3</NpgsqlVersion>
</PropertyGroup>

Expand All @@ -10,11 +10,11 @@
Dependencies on EF preview versions should be locked to a specific version (as provider-facing breaking changes are frequent).
For released versions, depend on anything in the current major version to allow users to update to higher patch versions.
-->
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="[10.0.4,11.0.0)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="[10.0.4,11.0.0)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="[10.0.4,11.0.0)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="[10.0.4,11.0.0)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="[10.0.4,11.0.0)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="[10.0.13,11.0.0)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="[10.0.13,11.0.0)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="[10.0.13,11.0.0)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="[10.0.13,11.0.0)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="[10.0.13,11.0.0)" />

<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MicrosoftExtensionsVersion)" />
Expand All @@ -25,12 +25,12 @@
<PackageVersion Include="Npgsql.NetTopologySuite" Version="$(NpgsqlVersion)" />
<PackageVersion Include="Npgsql.DependencyInjection" Version="$(NpgsqlVersion)" />

<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.303" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.402" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.11.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.assert" Version="2.9.3" />
<PackageVersion Include="xunit.core" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="4.0.1" />
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.5" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,18 @@ WHERE c."CustomerID" LIKE 'F%'
""");
}

public override async Task Update_Where_set_nullable_int_constant_via_discard_lambda(bool async)
{
await base.Update_Where_set_nullable_int_constant_via_discard_lambda(async);

AssertExecuteUpdateSql(
"""
UPDATE "Products" AS p
SET "SupplierID" = 1
WHERE p."ProductID" < 5
""");
}

public override async Task Update_Where_parameter_set_constant(bool async)
{
await base.Update_Where_parameter_set_constant(async);
Expand Down Expand Up @@ -1512,6 +1524,32 @@ public override async Task Update_FromSql_set_constant(bool async)
AssertExecuteUpdateSql();
}

public override async Task Update_with_select_mixed_entity_scalar_anonymous_projection(bool async)
{
await base.Update_with_select_mixed_entity_scalar_anonymous_projection(async);

AssertSql(
"""
@p='Updated'

UPDATE "Customers" AS c
SET "ContactName" = @p
""");
}

public override async Task Update_with_select_scalar_anonymous_projection(bool async)
{
await base.Update_with_select_scalar_anonymous_projection(async);

AssertSql(
"""
@p='Updated'

UPDATE "Customers" AS c
SET "ContactName" = @p
""");
}

public override async Task Update_Where_SelectMany_subquery_set_null(bool async)
{
await base.Update_Where_SelectMany_subquery_set_null(async);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,24 @@ LIMIT 1
""");
}

public override async Task Select_subquery_FirstOrDefault_complex_collection(QueryTrackingBehavior queryTrackingBehavior)
{
await base.Select_subquery_FirstOrDefault_complex_collection(queryTrackingBehavior);

AssertSql(
"""
SELECT r1.c, r1.c0
FROM "RootEntity" AS r
LEFT JOIN LATERAL (
SELECT r0."AssociateCollection" AS c, 1 AS c0
FROM "RootEntity" AS r0
ORDER BY r0."Id" NULLS FIRST
LIMIT 1
) AS r1 ON TRUE
ORDER BY r."Id" NULLS FIRST
""");
}

#endregion Subquery

#region Value types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,24 @@ LIMIT 1
""");
}

public override async Task Select_subquery_FirstOrDefault_complex_collection(QueryTrackingBehavior queryTrackingBehavior)
{
await base.Select_subquery_FirstOrDefault_complex_collection(queryTrackingBehavior);

AssertSql(
"""
SELECT r1."Id", r1."Name", r1."OptionalAssociate_Id", r1."OptionalAssociate_Int", r1."OptionalAssociate_Ints", r1."OptionalAssociate_Name", r1."OptionalAssociate_String", r1."OptionalAssociate_OptionalNestedAssociate_Id", r1."OptionalAssociate_OptionalNestedAssociate_Int", r1."OptionalAssociate_OptionalNestedAssociate_Ints", r1."OptionalAssociate_OptionalNestedAssociate_Name", r1."OptionalAssociate_OptionalNestedAssociate_String", r1."OptionalAssociate_RequiredNestedAssociate_Id", r1."OptionalAssociate_RequiredNestedAssociate_Int", r1."OptionalAssociate_RequiredNestedAssociate_Ints", r1."OptionalAssociate_RequiredNestedAssociate_Name", r1."OptionalAssociate_RequiredNestedAssociate_String", r1."RequiredAssociate_Id", r1."RequiredAssociate_Int", r1."RequiredAssociate_Ints", r1."RequiredAssociate_Name", r1."RequiredAssociate_String", r1."RequiredAssociate_OptionalNestedAssociate_Id", r1."RequiredAssociate_OptionalNestedAssociate_Int", r1."RequiredAssociate_OptionalNestedAssociate_Ints", r1."RequiredAssociate_OptionalNestedAssociate_Name", r1."RequiredAssociate_OptionalNestedAssociate_String", r1."RequiredAssociate_RequiredNestedAssociate_Id", r1."RequiredAssociate_RequiredNestedAssociate_Int", r1."RequiredAssociate_RequiredNestedAssociate_Ints", r1."RequiredAssociate_RequiredNestedAssociate_Name", r1."RequiredAssociate_RequiredNestedAssociate_String", r1.c
FROM "RootEntity" AS r
LEFT JOIN LATERAL (
SELECT r0."Id", r0."Name", r0."OptionalAssociate_Id", r0."OptionalAssociate_Int", r0."OptionalAssociate_Ints", r0."OptionalAssociate_Name", r0."OptionalAssociate_String", r0."OptionalAssociate_OptionalNestedAssociate_Id", r0."OptionalAssociate_OptionalNestedAssociate_Int", r0."OptionalAssociate_OptionalNestedAssociate_Ints", r0."OptionalAssociate_OptionalNestedAssociate_Name", r0."OptionalAssociate_OptionalNestedAssociate_String", r0."OptionalAssociate_RequiredNestedAssociate_Id", r0."OptionalAssociate_RequiredNestedAssociate_Int", r0."OptionalAssociate_RequiredNestedAssociate_Ints", r0."OptionalAssociate_RequiredNestedAssociate_Name", r0."OptionalAssociate_RequiredNestedAssociate_String", r0."RequiredAssociate_Id", r0."RequiredAssociate_Int", r0."RequiredAssociate_Ints", r0."RequiredAssociate_Name", r0."RequiredAssociate_String", r0."RequiredAssociate_OptionalNestedAssociate_Id", r0."RequiredAssociate_OptionalNestedAssociate_Int", r0."RequiredAssociate_OptionalNestedAssociate_Ints", r0."RequiredAssociate_OptionalNestedAssociate_Name", r0."RequiredAssociate_OptionalNestedAssociate_String", r0."RequiredAssociate_RequiredNestedAssociate_Id", r0."RequiredAssociate_RequiredNestedAssociate_Int", r0."RequiredAssociate_RequiredNestedAssociate_Ints", r0."RequiredAssociate_RequiredNestedAssociate_Name", r0."RequiredAssociate_RequiredNestedAssociate_String", 1 AS c
FROM "RootEntity" AS r0
ORDER BY r0."Id" NULLS FIRST
LIMIT 1
) AS r1 ON TRUE
ORDER BY r."Id" NULLS FIRST
""");
}

#endregion Subquery

#region Value types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,31 @@ LIMIT 1
""");
}

public override async Task Select_subquery_FirstOrDefault_complex_collection(QueryTrackingBehavior queryTrackingBehavior)
{
await base.Select_subquery_FirstOrDefault_complex_collection(queryTrackingBehavior);

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
FROM "RootEntity" AS r
LEFT JOIN LATERAL (
SELECT 1 AS c, r0."Id"
FROM "RootEntity" AS r0
ORDER BY r0."Id" NULLS FIRST
LIMIT 1
) AS r1 ON TRUE
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"
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" NULLS FIRST, r1."Id" NULLS FIRST, s."Id" NULLS FIRST, s."Id0" NULLS FIRST, s."Id1" NULLS FIRST
""");
}

#endregion Subquery

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,27 @@ LIMIT 1
}
}

public override async Task Select_subquery_FirstOrDefault_complex_collection(QueryTrackingBehavior queryTrackingBehavior)
{
await base.Select_subquery_FirstOrDefault_complex_collection(queryTrackingBehavior);

if (queryTrackingBehavior is not QueryTrackingBehavior.TrackAll)
{
AssertSql(
"""
SELECT r1.c, r1."Id", r1.c0
FROM "RootEntity" AS r
LEFT JOIN LATERAL (
SELECT r0."AssociateCollection" AS c, r0."Id", 1 AS c0
FROM "RootEntity" AS r0
ORDER BY r0."Id" NULLS FIRST
LIMIT 1
) AS r1 ON TRUE
ORDER BY r."Id" NULLS FIRST
""");
}
}

#endregion Subquery

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,34 @@ LIMIT 1
}
}

public override async Task Select_subquery_FirstOrDefault_complex_collection(QueryTrackingBehavior queryTrackingBehavior)
{
await base.Select_subquery_FirstOrDefault_complex_collection(queryTrackingBehavior);

if (queryTrackingBehavior is not QueryTrackingBehavior.TrackAll)
{
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
FROM "RootEntity" AS r
LEFT JOIN LATERAL (
SELECT 1 AS c, r0."Id"
FROM "RootEntity" AS r0
ORDER BY r0."Id" NULLS FIRST
LIMIT 1
) AS r5 ON TRUE
LEFT JOIN (
SELECT r1."RootEntityId", r1."Id", r1."Int", r1."Ints", r1."Name", r1."String", r2."AssociateTypeRootEntityId", r2."AssociateTypeId", r3."AssociateTypeRootEntityId" AS "AssociateTypeRootEntityId0", r3."AssociateTypeId" AS "AssociateTypeId0", r4."AssociateTypeRootEntityId" AS "AssociateTypeRootEntityId1", r4."AssociateTypeId" AS "AssociateTypeId1", r4."Id" AS "Id0", r4."Int" AS "Int0", r4."Ints" AS "Ints0", r4."Name" AS "Name0", r4."String" AS "String0", r2."Id" AS "Id1", r2."Int" AS "Int1", r2."Ints" AS "Ints1", r2."Name" AS "Name1", r2."String" AS "String1", r3."Id" AS "Id2", r3."Int" AS "Int2", r3."Ints" AS "Ints2", r3."Name" AS "Name2", r3."String" AS "String2"
FROM "RelatedCollection" AS r1
LEFT JOIN "RelatedCollection_OptionalNested" AS r2 ON r1."RootEntityId" = r2."AssociateTypeRootEntityId" AND r1."Id" = r2."AssociateTypeId"
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" NULLS FIRST, r5."Id" NULLS FIRST, s."RootEntityId" NULLS FIRST, s."Id" NULLS FIRST, s."AssociateTypeRootEntityId" NULLS FIRST, s."AssociateTypeId" NULLS FIRST, s."AssociateTypeRootEntityId0" NULLS FIRST, s."AssociateTypeId0" NULLS FIRST, s."AssociateTypeRootEntityId1" NULLS FIRST, s."AssociateTypeId1" NULLS FIRST
""");
}
}

#endregion Subquery

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,32 @@ LIMIT 1
}
}

public override async Task Select_subquery_FirstOrDefault_complex_collection(QueryTrackingBehavior queryTrackingBehavior)
{
await base.Select_subquery_FirstOrDefault_complex_collection(queryTrackingBehavior);

if (queryTrackingBehavior is not QueryTrackingBehavior.TrackAll)
{
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
FROM "RootEntity" AS r
LEFT JOIN LATERAL (
SELECT 1 AS c, r0."Id"
FROM "RootEntity" AS r0
ORDER BY r0."Id" NULLS FIRST
LIMIT 1
) AS r3 ON TRUE
LEFT JOIN (
SELECT r1."RootEntityId", r1."Id", r1."Int", r1."Ints", r1."Name", r1."String", r2."AssociateTypeRootEntityId", r2."AssociateTypeId", r2."Id" AS "Id0", r2."Int" AS "Int0", r2."Ints" AS "Ints0", r2."Name" AS "Name0", r2."String" AS "String0", r1."OptionalNestedAssociate_Id", r1."OptionalNestedAssociate_Int", r1."OptionalNestedAssociate_Ints", r1."OptionalNestedAssociate_Name", r1."OptionalNestedAssociate_String", r1."RequiredNestedAssociate_Id", r1."RequiredNestedAssociate_Int", r1."RequiredNestedAssociate_Ints", r1."RequiredNestedAssociate_Name", r1."RequiredNestedAssociate_String"
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" NULLS FIRST, r3."Id" NULLS FIRST, s."RootEntityId" NULLS FIRST, s."Id" NULLS FIRST, s."AssociateTypeRootEntityId" NULLS FIRST, s."AssociateTypeId" NULLS FIRST
""");
}
}

#endregion Subquery

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,18 @@ public override async Task Tpc_entity_owning_a_split_collection_on_leaf(bool asy
AssertSql();
}

public override async Task Compare_split_entity_to_null(bool async)
{
await base.Compare_split_entity_to_null(async);

AssertSql(
"""
SELECT e."Id", e."EntityThreeId", e."IntValue1", e."IntValue2", s."IntValue3", e."IntValue4", e."StringValue1", e."StringValue2", e."StringValue3", e."StringValue4"
FROM "EntityOne" AS e
INNER JOIN "SplitEntityOnePart" AS s ON e."Id" = s."Id"
""");
}

protected override ITestStoreFactory TestStoreFactory
=> NpgsqlTestStoreFactory.Instance;
}
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,21 @@ WHERE NOT (p."NullableInt" = ANY (@nullableInts) AND p."NullableInt" = ANY (@nul
""");
}

public override async Task Parameter_collection_of_nullable_ints_Contains_nullable_int_with_EF_Parameter()
{
await base.Parameter_collection_of_nullable_ints_Contains_nullable_int_with_EF_Parameter();

AssertSql(
"""
@nullableInts={ NULL
'999' } (DbType = Object)

SELECT p."Id", p."Bool", p."Bools", p."DateTime", p."DateTimes", p."Enum", p."Enums", p."Int", p."Ints", p."NullableInt", p."NullableInts", p."NullableString", p."NullableStrings", p."NullableWrappedId", p."NullableWrappedIdWithNullableComparer", p."String", p."Strings", p."WrappedId"
FROM "PrimitiveCollectionsEntity" AS p
WHERE p."NullableInt" = ANY (@nullableInts) OR (p."NullableInt" IS NULL AND array_position(@nullableInts, NULL) IS NOT NULL)
""");
}

public override async Task Parameter_collection_of_structs_Contains_struct()
{
await base.Parameter_collection_of_structs_Contains_struct();
Expand Down
Loading