Skip to content

Commit 7040a37

Browse files
authored
Sync to EF 10.0.0-preview.6.25321.102 (#3556)
1 parent ebafd5c commit 7040a37

File tree

3 files changed

+134
-149
lines changed

3 files changed

+134
-149
lines changed

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
<EFCoreVersion>10.0.0-preview.6.25314.101</EFCoreVersion>
4-
<MicrosoftExtensionsVersion>10.0.0-preview.6.25314.101</MicrosoftExtensionsVersion>
3+
<EFCoreVersion>10.0.0-preview.6.25321.102</EFCoreVersion>
4+
<MicrosoftExtensionsVersion>10.0.0-preview.6.25321.102</MicrosoftExtensionsVersion>
55
<NpgsqlVersion>9.0.3</NpgsqlVersion>
66
</PropertyGroup>
77

test/EFCore.PG.FunctionalTests/Query/NorthwindAggregateOperatorsQueryNpgsqlTest.cs

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,36 @@ public override async Task Contains_with_local_uint_array_closure(bool async)
6767
""");
6868
}
6969

70-
// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
71-
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
72-
//
73-
// public override async Task Contains_with_local_nullable_uint_array_closure(bool async)
74-
// {
75-
// await base.Contains_with_local_nullable_uint_array_closure(async);
76-
//
77-
// // Note: PostgreSQL doesn't support uint, but value converters make this into bigint
78-
//
79-
// AssertSql(
80-
// """
81-
// @ids={ '0', '1' } (DbType = Object)
82-
//
83-
// SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title"
84-
// FROM "Employees" AS e
85-
// WHERE e."EmployeeID" = ANY (@ids)
86-
// """,
87-
// //
88-
// """
89-
// @ids={ '0' } (DbType = Object)
90-
//
91-
// SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title"
92-
// FROM "Employees" AS e
93-
// WHERE e."EmployeeID" = ANY (@ids)
94-
// """);
95-
// }
96-
//
97-
// public override Task Contains_with_local_anonymous_type_array_closure(bool async)
98-
// // Aggregates. Issue #15937.
99-
// => AssertTranslationFailed(() => base.Contains_with_local_anonymous_type_array_closure(async));
100-
//
101-
// public override Task Contains_with_local_tuple_array_closure(bool async)
102-
// => Assert.ThrowsAsync<InvalidCastException>(() => base.Contains_with_local_tuple_array_closure(async: true));
70+
public override async Task Contains_with_local_nullable_uint_array_closure(bool async)
71+
{
72+
await base.Contains_with_local_nullable_uint_array_closure(async);
73+
74+
// Note: PostgreSQL doesn't support uint, but value converters make this into bigint
75+
76+
AssertSql(
77+
"""
78+
@ids={ '0', '1' } (DbType = Object)
79+
80+
SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title"
81+
FROM "Employees" AS e
82+
WHERE e."EmployeeID" = ANY (@ids)
83+
""",
84+
//
85+
"""
86+
@ids={ '0' } (DbType = Object)
87+
88+
SELECT e."EmployeeID", e."City", e."Country", e."FirstName", e."ReportsTo", e."Title"
89+
FROM "Employees" AS e
90+
WHERE e."EmployeeID" = ANY (@ids)
91+
""");
92+
}
93+
94+
public override Task Contains_with_local_anonymous_type_array_closure(bool async)
95+
// Aggregates. Issue #15937.
96+
=> AssertTranslationFailed(() => base.Contains_with_local_anonymous_type_array_closure(async));
97+
98+
public override Task Contains_with_local_tuple_array_closure(bool async)
99+
=> Assert.ThrowsAsync<InvalidCastException>(() => base.Contains_with_local_tuple_array_closure(async: true));
103100

104101
public override async Task Contains_with_local_enumerable_inline(bool async)
105102
{

test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs

Lines changed: 102 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,29 @@ public override async Task Inline_collection_of_ints_Contains(bool async)
2222
""");
2323
}
2424

25-
// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
26-
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
27-
//
28-
// public override async Task Inline_collection_of_nullable_ints_Contains(bool async)
29-
// {
30-
// await base.Inline_collection_of_nullable_ints_Contains(async);
31-
//
32-
// AssertSql(
33-
// """
34-
// 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"
35-
// FROM "PrimitiveCollectionsEntity" AS p
36-
// WHERE p."NullableInt" IN (10, 999)
37-
// """);
38-
// }
39-
//
40-
// public override async Task Inline_collection_of_nullable_ints_Contains_null(bool async)
41-
// {
42-
// await base.Inline_collection_of_nullable_ints_Contains_null(async);
43-
//
44-
// AssertSql(
45-
// """
46-
// 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"
47-
// FROM "PrimitiveCollectionsEntity" AS p
48-
// WHERE p."NullableInt" IS NULL OR p."NullableInt" = 999
49-
// """);
50-
// }
25+
public override async Task Inline_collection_of_nullable_ints_Contains(bool async)
26+
{
27+
await base.Inline_collection_of_nullable_ints_Contains(async);
28+
29+
AssertSql(
30+
"""
31+
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"
32+
FROM "PrimitiveCollectionsEntity" AS p
33+
WHERE p."NullableInt" IN (10, 999)
34+
""");
35+
}
36+
37+
public override async Task Inline_collection_of_nullable_ints_Contains_null(bool async)
38+
{
39+
await base.Inline_collection_of_nullable_ints_Contains_null(async);
40+
41+
AssertSql(
42+
"""
43+
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"
44+
FROM "PrimitiveCollectionsEntity" AS p
45+
WHERE p."NullableInt" IS NULL OR p."NullableInt" = 999
46+
""");
47+
}
5148

5249
public override async Task Inline_collection_Count_with_zero_values(bool async)
5350
{
@@ -575,52 +572,49 @@ WHERE NOT (p."NullableInt" = ANY (@ints) AND p."NullableInt" = ANY (@ints) IS NO
575572
""");
576573
}
577574

578-
// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
579-
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
580-
//
581-
// public override async Task Parameter_collection_of_nullable_ints_Contains_int(bool async)
582-
// {
583-
// await base.Parameter_collection_of_nullable_ints_Contains_int(async);
584-
//
585-
// AssertSql(
586-
// """
587-
// @nullableInts={ '10', '999' } (DbType = Object)
588-
//
589-
// 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"
590-
// FROM "PrimitiveCollectionsEntity" AS p
591-
// WHERE p."Int" = ANY (@nullableInts)
592-
// """,
593-
// //
594-
// """
595-
// @nullableInts={ '10', '999' } (DbType = Object)
596-
//
597-
// 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"
598-
// FROM "PrimitiveCollectionsEntity" AS p
599-
// WHERE NOT (p."Int" = ANY (@nullableInts) AND p."Int" = ANY (@nullableInts) IS NOT NULL)
600-
// """);
601-
// }
602-
//
603-
// public override async Task Parameter_collection_of_nullable_ints_Contains_nullable_int(bool async)
604-
// {
605-
// await base.Parameter_collection_of_nullable_ints_Contains_nullable_int(async);
606-
//
607-
// AssertSql(
608-
// """
609-
// @nullableInts={ NULL, '999' } (DbType = Object)
610-
//
611-
// 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"
612-
// FROM "PrimitiveCollectionsEntity" AS p
613-
// WHERE p."NullableInt" = ANY (@nullableInts) OR (p."NullableInt" IS NULL AND array_position(@nullableInts, NULL) IS NOT NULL)
614-
// """,
615-
// //
616-
// """
617-
// @nullableInts={ NULL, '999' } (DbType = Object)
618-
//
619-
// 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"
620-
// FROM "PrimitiveCollectionsEntity" AS p
621-
// WHERE NOT (p."NullableInt" = ANY (@nullableInts) AND p."NullableInt" = ANY (@nullableInts) IS NOT NULL) AND (p."NullableInt" IS NOT NULL OR array_position(@nullableInts, NULL) IS NULL)
622-
// """);
623-
// }
575+
public override async Task Parameter_collection_of_nullable_ints_Contains_int(bool async)
576+
{
577+
await base.Parameter_collection_of_nullable_ints_Contains_int(async);
578+
579+
AssertSql(
580+
"""
581+
@nullableInts={ '10', '999' } (DbType = Object)
582+
583+
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"
584+
FROM "PrimitiveCollectionsEntity" AS p
585+
WHERE p."Int" = ANY (@nullableInts)
586+
""",
587+
//
588+
"""
589+
@nullableInts={ '10', '999' } (DbType = Object)
590+
591+
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"
592+
FROM "PrimitiveCollectionsEntity" AS p
593+
WHERE NOT (p."Int" = ANY (@nullableInts) AND p."Int" = ANY (@nullableInts) IS NOT NULL)
594+
""");
595+
}
596+
597+
public override async Task Parameter_collection_of_nullable_ints_Contains_nullable_int(bool async)
598+
{
599+
await base.Parameter_collection_of_nullable_ints_Contains_nullable_int(async);
600+
601+
AssertSql(
602+
"""
603+
@nullableInts={ NULL, '999' } (DbType = Object)
604+
605+
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"
606+
FROM "PrimitiveCollectionsEntity" AS p
607+
WHERE p."NullableInt" = ANY (@nullableInts) OR (p."NullableInt" IS NULL AND array_position(@nullableInts, NULL) IS NOT NULL)
608+
""",
609+
//
610+
"""
611+
@nullableInts={ NULL, '999' } (DbType = Object)
612+
613+
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"
614+
FROM "PrimitiveCollectionsEntity" AS p
615+
WHERE NOT (p."NullableInt" = ANY (@nullableInts) AND p."NullableInt" = ANY (@nullableInts) IS NOT NULL) AND (p."NullableInt" IS NOT NULL OR array_position(@nullableInts, NULL) IS NULL)
616+
""");
617+
}
624618

625619
public override async Task Parameter_collection_of_structs_Contains_struct(bool async)
626620
{
@@ -760,22 +754,19 @@ public override async Task Parameter_collection_of_bools_Contains(bool async)
760754
""");
761755
}
762756

763-
// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
764-
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
765-
//
766-
// public override async Task Parameter_collection_of_enums_Contains(bool async)
767-
// {
768-
// await base.Parameter_collection_of_enums_Contains(async);
769-
//
770-
// AssertSql(
771-
// """
772-
// @enums={ '0', '3' } (DbType = Object)
773-
//
774-
// 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"
775-
// FROM "PrimitiveCollectionsEntity" AS p
776-
// WHERE p."Enum" = ANY (@enums)
777-
// """);
778-
// }
757+
public override async Task Parameter_collection_of_enums_Contains(bool async)
758+
{
759+
await base.Parameter_collection_of_enums_Contains(async);
760+
761+
AssertSql(
762+
"""
763+
@enums={ '0', '3' } (DbType = Object)
764+
765+
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"
766+
FROM "PrimitiveCollectionsEntity" AS p
767+
WHERE p."Enum" = ANY (@enums)
768+
""");
769+
}
779770

780771
public override async Task Parameter_collection_null_Contains(bool async)
781772
{
@@ -869,32 +860,29 @@ public override async Task Column_collection_of_ints_Contains(bool async)
869860
""");
870861
}
871862

872-
// TODO: The base implementations no longer compile since https://github.com/dotnet/runtime/pull/110197 (Contains overload added with
873-
// optional parameter, not supported in expression trees). #35547 is tracking on the EF side.
874-
//
875-
// public override async Task Column_collection_of_nullable_ints_Contains(bool async)
876-
// {
877-
// await base.Column_collection_of_nullable_ints_Contains(async);
878-
//
879-
// AssertSql(
880-
// """
881-
// 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"
882-
// FROM "PrimitiveCollectionsEntity" AS p
883-
// WHERE p."NullableInts" @> ARRAY[10]::integer[]
884-
// """);
885-
// }
886-
//
887-
// public override async Task Column_collection_of_nullable_ints_Contains_null(bool async)
888-
// {
889-
// await base.Column_collection_of_nullable_ints_Contains_null(async);
890-
//
891-
// AssertSql(
892-
// """
893-
// 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"
894-
// FROM "PrimitiveCollectionsEntity" AS p
895-
// WHERE array_position(p."NullableInts", NULL) IS NOT NULL
896-
// """);
897-
// }
863+
public override async Task Column_collection_of_nullable_ints_Contains(bool async)
864+
{
865+
await base.Column_collection_of_nullable_ints_Contains(async);
866+
867+
AssertSql(
868+
"""
869+
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"
870+
FROM "PrimitiveCollectionsEntity" AS p
871+
WHERE p."NullableInts" @> ARRAY[10]::integer[]
872+
""");
873+
}
874+
875+
public override async Task Column_collection_of_nullable_ints_Contains_null(bool async)
876+
{
877+
await base.Column_collection_of_nullable_ints_Contains_null(async);
878+
879+
AssertSql(
880+
"""
881+
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"
882+
FROM "PrimitiveCollectionsEntity" AS p
883+
WHERE array_position(p."NullableInts", NULL) IS NOT NULL
884+
""");
885+
}
898886

899887
public override async Task Column_collection_of_strings_contains_null(bool async)
900888
{

0 commit comments

Comments
 (0)