From a16bf8fef518d1447852fdd5c588de7834674eff Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Mon, 20 Nov 2023 13:57:37 -0800 Subject: [PATCH 1/2] Test new sqlite3mc SQLitePCLRaw bundle --- EFCore.sln | 7 +++++++ Microsoft.Data.Sqlite.slnf | 1 + .../EFCore.Sqlite.Benchmarks.csproj | 2 +- src/EFCore.Sqlite/EFCore.Sqlite.csproj | 2 +- .../Extensions/SQLitePCLExtensions.cs | 2 ++ .../Microsoft.Data.Sqlite.Core.csproj | 2 +- .../Properties/InternalsVisibleTo.cs | 2 ++ .../Microsoft.Data.Sqlite.csproj | 2 +- .../EFCore.Design.Tests.csproj | 2 +- .../EFCore.NativeAotTests.csproj | 2 +- .../EFCore.Sqlite.FunctionalTests.csproj | 2 +- .../PrimitiveCollectionsQuerySqliteTest.cs | 13 +++++++------ .../EFCore.TrimmingTests.csproj | 2 +- .../Microsoft.Data.Sqlite.Tests.csproj | 2 +- ...crosoft.Data.Sqlite.e_sqlcipher.Tests.csproj | 2 +- ...crosoft.Data.Sqlite.e_sqlite3mc.Tests.csproj | 17 +++++++++++++++++ .../Microsoft.Data.Sqlite.sqlite3.Tests.csproj | 2 +- ...icrosoft.Data.Sqlite.winsqlite3.Tests.csproj | 2 +- .../SqliteConnectionTest.cs | 4 ++-- .../TestUtilities/SqliteTestFramework.cs | 2 ++ 20 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.e_sqlite3mc.Tests.csproj diff --git a/EFCore.sln b/EFCore.sln index 8bd06458baa..d45bf85cdf0 100644 --- a/EFCore.sln +++ b/EFCore.sln @@ -108,6 +108,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Benchmarks", "benchm EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.Sqlite.e_sqlcipher.Tests", "test\Microsoft.Data.Sqlite.Tests\Microsoft.Data.Sqlite.e_sqlcipher.Tests.csproj", "{7B598E0C-B8E2-4F1F-B53C-ED84178E65BE}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.Sqlite.e_sqlite3mc.Tests", "test\Microsoft.Data.Sqlite.Tests\Microsoft.Data.Sqlite.e_sqlite3mc.Tests.csproj", "{203F3577-9E24-4714-AD31-F119B26FA8C1}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.Sqlite.winsqlite3.Tests", "test\Microsoft.Data.Sqlite.Tests\Microsoft.Data.Sqlite.winsqlite3.Tests.csproj", "{B163761D-FB4A-4C80-BAB9-01905E1351EF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.Sqlite.sqlite3.Tests", "test\Microsoft.Data.Sqlite.Tests\Microsoft.Data.Sqlite.sqlite3.Tests.csproj", "{E0FF35C8-8038-4394-9C2A-AF34BE3CC61F}" @@ -306,6 +308,10 @@ Global {7B598E0C-B8E2-4F1F-B53C-ED84178E65BE}.Debug|Any CPU.Build.0 = Debug|Any CPU {7B598E0C-B8E2-4F1F-B53C-ED84178E65BE}.Release|Any CPU.ActiveCfg = Release|Any CPU {7B598E0C-B8E2-4F1F-B53C-ED84178E65BE}.Release|Any CPU.Build.0 = Release|Any CPU + {203F3577-9E24-4714-AD31-F119B26FA8C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {203F3577-9E24-4714-AD31-F119B26FA8C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {203F3577-9E24-4714-AD31-F119B26FA8C1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {203F3577-9E24-4714-AD31-F119B26FA8C1}.Release|Any CPU.Build.0 = Release|Any CPU {B163761D-FB4A-4C80-BAB9-01905E1351EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B163761D-FB4A-4C80-BAB9-01905E1351EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {B163761D-FB4A-4C80-BAB9-01905E1351EF}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -404,6 +410,7 @@ Global {5A44F67E-517F-458D-B9C7-12A4DBBAD64A} = {293B4F79-3CB9-402A-A74C-B8108C41A7CF} {2642F4F0-69BE-4C43-94B7-B298FEC87D89} = {293B4F79-3CB9-402A-A74C-B8108C41A7CF} {7B598E0C-B8E2-4F1F-B53C-ED84178E65BE} = {258D5057-81B9-40EC-A872-D21E27452749} + {203F3577-9E24-4714-AD31-F119B26FA8C1} = {258D5057-81B9-40EC-A872-D21E27452749} {B163761D-FB4A-4C80-BAB9-01905E1351EF} = {258D5057-81B9-40EC-A872-D21E27452749} {E0FF35C8-8038-4394-9C2A-AF34BE3CC61F} = {258D5057-81B9-40EC-A872-D21E27452749} {7C0E5443-FE44-4436-8A7D-CE64D1F889BD} = {258D5057-81B9-40EC-A872-D21E27452749} diff --git a/Microsoft.Data.Sqlite.slnf b/Microsoft.Data.Sqlite.slnf index 993d24cad16..f70d63bf969 100644 --- a/Microsoft.Data.Sqlite.slnf +++ b/Microsoft.Data.Sqlite.slnf @@ -6,6 +6,7 @@ "src\\Microsoft.Data.Sqlite\\Microsoft.Data.Sqlite.csproj", "test\\Microsoft.Data.Sqlite.Tests\\Microsoft.Data.Sqlite.Tests.csproj", "test\\Microsoft.Data.Sqlite.Tests\\Microsoft.Data.Sqlite.e_sqlcipher.Tests.csproj", + "test\\Microsoft.Data.Sqlite.Tests\\Microsoft.Data.Sqlite.e_sqlite3mc.Tests.csproj", "test\\Microsoft.Data.Sqlite.Tests\\Microsoft.Data.Sqlite.sqlite3.Tests.csproj", "test\\Microsoft.Data.Sqlite.Tests\\Microsoft.Data.Sqlite.winsqlite3.Tests.csproj" ] diff --git a/benchmark/EFCore.Sqlite.Benchmarks/EFCore.Sqlite.Benchmarks.csproj b/benchmark/EFCore.Sqlite.Benchmarks/EFCore.Sqlite.Benchmarks.csproj index b693456dfed..18a79f0cd70 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/EFCore.Sqlite.Benchmarks.csproj +++ b/benchmark/EFCore.Sqlite.Benchmarks/EFCore.Sqlite.Benchmarks.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/EFCore.Sqlite/EFCore.Sqlite.csproj b/src/EFCore.Sqlite/EFCore.Sqlite.csproj index f728029ae0c..61043d5c9b0 100644 --- a/src/EFCore.Sqlite/EFCore.Sqlite.csproj +++ b/src/EFCore.Sqlite/EFCore.Sqlite.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.Data.Sqlite.Core/Extensions/SQLitePCLExtensions.cs b/src/Microsoft.Data.Sqlite.Core/Extensions/SQLitePCLExtensions.cs index 673f8a7f910..c854b8f837a 100644 --- a/src/Microsoft.Data.Sqlite.Core/Extensions/SQLitePCLExtensions.cs +++ b/src/Microsoft.Data.Sqlite.Core/Extensions/SQLitePCLExtensions.cs @@ -13,7 +13,9 @@ internal static class SQLitePCLExtensions { { "e_sqlcipher", true }, { "e_sqlite3", false }, + { "e_sqlite3mc", true }, { "sqlcipher", true }, + { "sqlite3mc", true }, { "winsqlite3", false } }; diff --git a/src/Microsoft.Data.Sqlite.Core/Microsoft.Data.Sqlite.Core.csproj b/src/Microsoft.Data.Sqlite.Core/Microsoft.Data.Sqlite.Core.csproj index 525245c8847..aadba64a781 100644 --- a/src/Microsoft.Data.Sqlite.Core/Microsoft.Data.Sqlite.Core.csproj +++ b/src/Microsoft.Data.Sqlite.Core/Microsoft.Data.Sqlite.Core.csproj @@ -40,7 +40,7 @@ Microsoft.Data.Sqlite.SqliteTransaction - + diff --git a/src/Microsoft.Data.Sqlite.Core/Properties/InternalsVisibleTo.cs b/src/Microsoft.Data.Sqlite.Core/Properties/InternalsVisibleTo.cs index a4f553a153b..30f05a579ca 100644 --- a/src/Microsoft.Data.Sqlite.Core/Properties/InternalsVisibleTo.cs +++ b/src/Microsoft.Data.Sqlite.Core/Properties/InternalsVisibleTo.cs @@ -5,6 +5,8 @@ [assembly: InternalsVisibleTo( "Microsoft.Data.Sqlite.e_sqlcipher.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo( + "Microsoft.Data.Sqlite.e_sqlite3mc.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo( "Microsoft.Data.Sqlite.sqlite3.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo( diff --git a/src/Microsoft.Data.Sqlite/Microsoft.Data.Sqlite.csproj b/src/Microsoft.Data.Sqlite/Microsoft.Data.Sqlite.csproj index 34cd41f43ec..76649043401 100644 --- a/src/Microsoft.Data.Sqlite/Microsoft.Data.Sqlite.csproj +++ b/src/Microsoft.Data.Sqlite/Microsoft.Data.Sqlite.csproj @@ -24,7 +24,7 @@ Microsoft.Data.Sqlite.SqliteTransaction - + diff --git a/test/EFCore.Design.Tests/EFCore.Design.Tests.csproj b/test/EFCore.Design.Tests/EFCore.Design.Tests.csproj index 06452c6407c..27de1ad0009 100644 --- a/test/EFCore.Design.Tests/EFCore.Design.Tests.csproj +++ b/test/EFCore.Design.Tests/EFCore.Design.Tests.csproj @@ -57,7 +57,7 @@ - + diff --git a/test/EFCore.NativeAotTests/EFCore.NativeAotTests.csproj b/test/EFCore.NativeAotTests/EFCore.NativeAotTests.csproj index 1dd35abe704..275b12b5214 100644 --- a/test/EFCore.NativeAotTests/EFCore.NativeAotTests.csproj +++ b/test/EFCore.NativeAotTests/EFCore.NativeAotTests.csproj @@ -19,7 +19,7 @@ - + diff --git a/test/EFCore.Sqlite.FunctionalTests/EFCore.Sqlite.FunctionalTests.csproj b/test/EFCore.Sqlite.FunctionalTests/EFCore.Sqlite.FunctionalTests.csproj index ca618c3ae1b..a4def1907a7 100644 --- a/test/EFCore.Sqlite.FunctionalTests/EFCore.Sqlite.FunctionalTests.csproj +++ b/test/EFCore.Sqlite.FunctionalTests/EFCore.Sqlite.FunctionalTests.csproj @@ -61,7 +61,7 @@ - + diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs index 86730055fb7..ddb8a5216b1 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs @@ -833,6 +833,7 @@ INNER JOIN json_each("p"."Ints") AS "i" ON "v"."Value" = "i"."value") = 2 """); } + [ConditionalFact(Skip = "Underlying SQLite issue")] public override async Task Parameter_collection_Concat_column_collection(bool async) { await base.Parameter_collection_Concat_column_collection(async); @@ -1212,12 +1213,12 @@ FROM json_each(@__strings_0) AS "s" """); } - public override async Task Nested_contains_with_arrays_and_no_inferred_type_mapping(bool async) - { - await base.Nested_contains_with_arrays_and_no_inferred_type_mapping(async); + public override async Task Nested_contains_with_arrays_and_no_inferred_type_mapping(bool async) + { + await base.Nested_contains_with_arrays_and_no_inferred_type_mapping(async); - AssertSql( - """ + AssertSql( + """ @__ints_1='[1,2,3]' (Size = 7) @__strings_0='["one","two","three"]' (Size = 21) @@ -1234,7 +1235,7 @@ END IN ( FROM json_each(@__strings_0) AS "s" ) """); - } + } [ConditionalFact] public virtual void Check_all_tests_overridden() diff --git a/test/EFCore.TrimmingTests/EFCore.TrimmingTests.csproj b/test/EFCore.TrimmingTests/EFCore.TrimmingTests.csproj index bacc38a4e78..7ecd80c3397 100644 --- a/test/EFCore.TrimmingTests/EFCore.TrimmingTests.csproj +++ b/test/EFCore.TrimmingTests/EFCore.TrimmingTests.csproj @@ -18,7 +18,7 @@ - + diff --git a/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.Tests.csproj b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.Tests.csproj index 2d4105b10d2..7a1bfe2f8e6 100644 --- a/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.Tests.csproj +++ b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.e_sqlcipher.Tests.csproj b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.e_sqlcipher.Tests.csproj index 71c22ec4806..f443c5b5464 100644 --- a/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.e_sqlcipher.Tests.csproj +++ b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.e_sqlcipher.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.e_sqlite3mc.Tests.csproj b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.e_sqlite3mc.Tests.csproj new file mode 100644 index 00000000000..6250a77c0c4 --- /dev/null +++ b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.e_sqlite3mc.Tests.csproj @@ -0,0 +1,17 @@ + + + + $(DefaultNetCoreTargetFramework);net462 + $(DefineConstants);E_SQLITE3MC + enable + + + + + + + + + + + diff --git a/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.sqlite3.Tests.csproj b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.sqlite3.Tests.csproj index 26e733f085e..1304e03dcab 100644 --- a/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.sqlite3.Tests.csproj +++ b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.sqlite3.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.winsqlite3.Tests.csproj b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.winsqlite3.Tests.csproj index 7a8b5f7933a..fcf5829c9bb 100644 --- a/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.winsqlite3.Tests.csproj +++ b/test/Microsoft.Data.Sqlite.Tests/Microsoft.Data.Sqlite.winsqlite3.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/Microsoft.Data.Sqlite.Tests/SqliteConnectionTest.cs b/test/Microsoft.Data.Sqlite.Tests/SqliteConnectionTest.cs index 5639a128262..42c8f162a6d 100644 --- a/test/Microsoft.Data.Sqlite.Tests/SqliteConnectionTest.cs +++ b/test/Microsoft.Data.Sqlite.Tests/SqliteConnectionTest.cs @@ -267,7 +267,7 @@ public void Open_works_when_password() { #if E_SQLITE3 || WINSQLITE3 Open_works_when_password_unsupported(); -#elif E_SQLCIPHER || SQLCIPHER +#elif E_SQLCIPHER || E_SQLITE3MC || SQLCIPHER Open_works_when_password_supported(); #elif SQLITE3 Open_works_when_password_might_be_supported(); @@ -314,7 +314,7 @@ private void Open_works_when_password_might_be_supported() connection.Open(); } -#if E_SQLCIPHER || SQLCIPHER +#if E_SQLCIPHER || E_SQLITE3MC || SQLCIPHER [Fact] public void Open_decrypts_lazily_when_no_password() { diff --git a/test/Microsoft.Data.Sqlite.Tests/TestUtilities/SqliteTestFramework.cs b/test/Microsoft.Data.Sqlite.Tests/TestUtilities/SqliteTestFramework.cs index 3ba974ba302..574199eff33 100644 --- a/test/Microsoft.Data.Sqlite.Tests/TestUtilities/SqliteTestFramework.cs +++ b/test/Microsoft.Data.Sqlite.Tests/TestUtilities/SqliteTestFramework.cs @@ -18,6 +18,8 @@ "Microsoft.Data.Sqlite.Tests")] #elif E_SQLCIPHER "Microsoft.Data.Sqlite.e_sqlcipher.Tests")] +#elif E_SQLITE3MC + "Microsoft.Data.Sqlite.e_sqlite3mc.Tests")] #elif WINSQLITE3 "Microsoft.Data.Sqlite.winsqlite3.Tests")] #elif SQLITE3 From 29a6a9f4735e99baba2b5b1bb05b80d6f718cb39 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Fri, 8 Dec 2023 12:45:09 +0000 Subject: [PATCH 2/2] Disable test. --- .../Query/PrimitiveCollectionsQuerySqliteTest.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs index ddb8a5216b1..31b098064a8 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/PrimitiveCollectionsQuerySqliteTest.cs @@ -3,6 +3,7 @@ using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore.Sqlite.Internal; +using Xunit.Sdk; namespace Microsoft.EntityFrameworkCore.Query; @@ -833,10 +834,12 @@ INNER JOIN json_each("p"."Ints") AS "i" ON "v"."Value" = "i"."value") = 2 """); } - [ConditionalFact(Skip = "Underlying SQLite issue")] + [ConditionalTheory] public override async Task Parameter_collection_Concat_column_collection(bool async) { - await base.Parameter_collection_Concat_column_collection(async); + // Issue #32561 + await Assert.ThrowsAsync( + () => base.Parameter_collection_Concat_column_collection(async)); AssertSql( """