diff --git a/Directory.Packages.props b/Directory.Packages.props index c20177900..adf8413b5 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,6 +1,6 @@ - 10.0.0-alpha.1.25070.1 + 10.0.0-alpha.1.25074.3 10.0.0-alpha.1.25068.1 9.0.2 diff --git a/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs index fe82007bf..ced876e7c 100644 --- a/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/PrecompiledQueryNpgsqlTest.cs @@ -9,7 +9,7 @@ public class PrecompiledQueryNpgsqlTest( IClassFixture { protected override bool AlwaysPrintGeneratedSources - => true; + => false; #region Expression types @@ -269,6 +269,149 @@ public virtual async Task Collate() #endregion Expression types + #region Regular operators + + public override async Task OrderBy() + { + await base.OrderBy(); + + AssertSql( + """ +SELECT b."Id", b."Name", b."Json" +FROM "Blogs" AS b +ORDER BY b."Name" NULLS FIRST +"""); + } + + public override async Task Skip_with_constant() + { + await base.Skip_with_constant(); + + AssertSql( + """ +@p='1' + +SELECT b."Id", b."Name", b."Json" +FROM "Blogs" AS b +ORDER BY b."Name" NULLS FIRST +OFFSET @p +"""); + } + + public override async Task Skip_with_parameter() + { + await base.Skip_with_parameter(); + + AssertSql( + """ +@p='1' + +SELECT b."Id", b."Name", b."Json" +FROM "Blogs" AS b +ORDER BY b."Name" NULLS FIRST +OFFSET @p +"""); + } + + public override async Task Take_with_constant() + { + await base.Take_with_constant(); + + AssertSql( + """ +@p='1' + +SELECT b."Id", b."Name", b."Json" +FROM "Blogs" AS b +ORDER BY b."Name" NULLS FIRST +LIMIT @p +"""); + } + + public override async Task Take_with_parameter() + { + await base.Take_with_parameter(); + + AssertSql( + """ +@p='1' + +SELECT b."Id", b."Name", b."Json" +FROM "Blogs" AS b +ORDER BY b."Name" NULLS FIRST +LIMIT @p +"""); + } + + public override async Task Select_changes_type() + { + await base.Select_changes_type(); + + AssertSql( + """ +SELECT b."Name" +FROM "Blogs" AS b +"""); + } + + public override async Task Select_anonymous_object() + { + await base.Select_anonymous_object(); + + AssertSql( + """ +SELECT COALESCE(b."Name", '') || 'Foo' AS "Foo" +FROM "Blogs" AS b +"""); + } + + public override async Task Include_single() + { + await base.Include_single(); + + AssertSql( + """ +SELECT b."Id", b."Name", b."Json", p."Id", p."BlogId", p."Title" +FROM "Blogs" AS b +LEFT JOIN "Posts" AS p ON b."Id" = p."BlogId" +WHERE b."Id" > 8 +ORDER BY b."Id" NULLS FIRST +"""); + } + + public override async Task Include_split() + { + await base.Include_split(); + + AssertSql( + """ +SELECT b."Id", b."Name", b."Json" +FROM "Blogs" AS b +ORDER BY b."Id" NULLS FIRST +""", + // + """ +SELECT p."Id", p."BlogId", p."Title", b."Id" +FROM "Blogs" AS b +INNER JOIN "Posts" AS p ON b."Id" = p."BlogId" +ORDER BY b."Id" NULLS FIRST +"""); + } + + public override async Task Final_GroupBy() + { + await base.Final_GroupBy(); + + AssertSql( + """ +SELECT b."Name", b."Id", b."Json" +FROM "Blogs" AS b +ORDER BY b."Name" NULLS FIRST +"""); + } + + #endregion Regular operators + #region Terminating operators public override async Task Terminating_AsEnumerable() @@ -1445,6 +1588,26 @@ SELECT count(*)::int """); } + public override async Task Terminating_with_cancellation_token() + { + await base.Terminating_with_cancellation_token(); + + AssertSql( + """ +SELECT b."Id", b."Name", b."Json" +FROM "Blogs" AS b +WHERE b."Id" = 8 +LIMIT 1 +""", + // + """ +SELECT b."Id", b."Name", b."Json" +FROM "Blogs" AS b +WHERE b."Id" = 7 +LIMIT 1 +"""); + } + #endregion Reducing terminating operators #region SQL expression quotability @@ -1730,127 +1893,7 @@ public override async Task DbContext_as_method_invocation_result() #endregion Different query roots - #region Negative cases - - public override async Task Dynamic_query_does_not_get_precompiled() - { - await base.Dynamic_query_does_not_get_precompiled(); - - AssertSql(); - } - - public override async Task ToList_over_objects_does_not_get_precompiled() - { - await base.ToList_over_objects_does_not_get_precompiled(); - - AssertSql(); - } - - public override async Task Query_compilation_failure() - { - await base.Query_compilation_failure(); - - AssertSql(); - } - - public override async Task EF_Constant_is_not_supported() - { - await base.EF_Constant_is_not_supported(); - - AssertSql(); - } - - public override async Task NotParameterizedAttribute_with_constant() - { - await base.NotParameterizedAttribute_with_constant(); -AssertSql( - """ -SELECT b."Id", b."Name", b."Json" -FROM "Blogs" AS b -WHERE b."Name" = 'Blog2' -LIMIT 2 -"""); - } - - public override async Task NotParameterizedAttribute_is_not_supported_with_non_constant_argument() - { - await base.NotParameterizedAttribute_is_not_supported_with_non_constant_argument(); - - AssertSql(); - } - - public override async Task Query_syntax_is_not_supported() - { - await base.Query_syntax_is_not_supported(); - - AssertSql(); - } - - #endregion Negative cases - - public override async Task Select_changes_type() - { - await base.Select_changes_type(); - - AssertSql( - """ -SELECT b."Name" -FROM "Blogs" AS b -"""); - } - - public override async Task OrderBy() - { - await base.OrderBy(); - -AssertSql( - """ -SELECT b."Id", b."Name", b."Json" -FROM "Blogs" AS b -ORDER BY b."Name" NULLS FIRST -"""); - } - - public override async Task Skip() - { - await base.Skip(); - - AssertSql( - """ -@p='1' - -SELECT b."Id", b."Name", b."Json" -FROM "Blogs" AS b -ORDER BY b."Name" NULLS FIRST -OFFSET @p -"""); - } - - public override async Task Take() - { - await base.Take(); - - AssertSql( - """ -@p='1' - -SELECT b."Id", b."Name", b."Json" -FROM "Blogs" AS b -ORDER BY b."Name" NULLS FIRST -LIMIT @p -"""); - } - - public override async Task Project_anonymous_object() - { - await base.Project_anonymous_object(); - - AssertSql( - """ -SELECT COALESCE(b."Name", '') || 'Foo' AS "Foo" -FROM "Blogs" AS b -"""); - } + #region Captured variable handling public override async Task Two_captured_variables_in_same_lambda() { @@ -1915,75 +1958,90 @@ WHERE b."Name" LIKE @foo_startswith AND b."Name" LIKE @foo_endswith """); } - public override async Task Include_single() + public override async Task Multiple_queries_with_captured_variables() { - await base.Include_single(); + await base.Multiple_queries_with_captured_variables(); AssertSql( """ -SELECT b."Id", b."Name", b."Json", p."Id", p."BlogId", p."Title" -FROM "Blogs" AS b -LEFT JOIN "Posts" AS p ON b."Id" = p."BlogId" -WHERE b."Id" > 8 -ORDER BY b."Id" NULLS FIRST -"""); - } - - public override async Task Include_split() - { - await base.Include_split(); +@id1='8' +@id2='9' - AssertSql( - """ SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -ORDER BY b."Id" NULLS FIRST +WHERE b."Id" = @id1 OR b."Id" = @id2 """, - // - """ -SELECT p."Id", p."BlogId", p."Title", b."Id" + // + """ +@id1='8' + +SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -INNER JOIN "Posts" AS p ON b."Id" = p."BlogId" -ORDER BY b."Id" NULLS FIRST +WHERE b."Id" = @id1 +LIMIT 2 """); } - public override async Task Final_GroupBy() + #endregion Captured variable handling + + #region Negative cases + + public override async Task Dynamic_query_does_not_get_precompiled() { - await base.Final_GroupBy(); + await base.Dynamic_query_does_not_get_precompiled(); - AssertSql( - """ -SELECT b."Name", b."Id", b."Json" -FROM "Blogs" AS b -ORDER BY b."Name" NULLS FIRST -"""); + AssertSql(); } - public override async Task Multiple_queries_with_captured_variables() + public override async Task ToList_over_objects_does_not_get_precompiled() { - await base.Multiple_queries_with_captured_variables(); + await base.ToList_over_objects_does_not_get_precompiled(); - AssertSql( - """ -@id1='8' -@id2='9' + AssertSql(); + } -SELECT b."Id", b."Name", b."Json" -FROM "Blogs" AS b -WHERE b."Id" = @id1 OR b."Id" = @id2 -""", - // - """ -@id1='8' + public override async Task Query_compilation_failure() + { + await base.Query_compilation_failure(); + AssertSql(); + } + + public override async Task EF_Constant_is_not_supported() + { + await base.EF_Constant_is_not_supported(); + + AssertSql(); + } + + public override async Task NotParameterizedAttribute_with_constant() + { + await base.NotParameterizedAttribute_with_constant(); +AssertSql( + """ SELECT b."Id", b."Name", b."Json" FROM "Blogs" AS b -WHERE b."Id" = @id1 +WHERE b."Name" = 'Blog2' LIMIT 2 """); } + public override async Task NotParameterizedAttribute_is_not_supported_with_non_constant_argument() + { + await base.NotParameterizedAttribute_is_not_supported_with_non_constant_argument(); + + AssertSql(); + } + + public override async Task Query_syntax_is_not_supported() + { + await base.Query_syntax_is_not_supported(); + + AssertSql(); + } + + #endregion Negative cases + public override async Task Unsafe_accessor_gets_generated_once_for_multiple_queries() { await base.Unsafe_accessor_gets_generated_once_for_multiple_queries(); diff --git a/test/EFCore.PG.FunctionalTests/Query/Translations/ByteArrayTranslationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Translations/ByteArrayTranslationsNpgsqlTest.cs new file mode 100644 index 000000000..898a0777d --- /dev/null +++ b/test/EFCore.PG.FunctionalTests/Query/Translations/ByteArrayTranslationsNpgsqlTest.cs @@ -0,0 +1,103 @@ +namespace Microsoft.EntityFrameworkCore.Query.Translations; + +public class ByteArrayTranslationsNpgsqlTest : ByteArrayTranslationsTestBase +{ + // ReSharper disable once UnusedParameter.Local + public ByteArrayTranslationsNpgsqlTest(BasicTypesQueryNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) + : base(fixture) + { + Fixture.TestSqlLoggerFactory.Clear(); + Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper); + } + + public override async Task Length(bool async) + { + await base.Length(async); + + AssertSql( + """ +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE length(b."ByteArray") = 4 +"""); + } + + public override async Task Index(bool async) + { + await base.Index(async); + + AssertSql( + """ +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE length(b."ByteArray") >= 3 AND get_byte(b."ByteArray", 2) = 190 +"""); + } + + public override async Task First(bool async) + { + await base.First(async); + + AssertSql( + """ +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE length(b."ByteArray") >= 1 AND get_byte(b."ByteArray", 0)::smallint = 222 +"""); + } + + public override async Task Contains_with_constant(bool async) + { + await base.Contains_with_constant(async); + + AssertSql( + """ +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE position(BYTEA E'\\x01' IN b."ByteArray") > 0 +"""); + } + + public override async Task Contains_with_parameter(bool async) + { + await base.Contains_with_parameter(async); + + AssertSql( + """ +@someByte='1' (DbType = Int16) + +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE position(set_byte(BYTEA E'\\x00', 0, @someByte) IN b."ByteArray") > 0 +"""); + } + + public override async Task Contains_with_column(bool async) + { + await base.Contains_with_column(async); + + AssertSql( + """ +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE position(set_byte(BYTEA E'\\x00', 0, b."Byte") IN b."ByteArray") > 0 +"""); + } + + public override async Task SequenceEqual(bool async) + { + await base.SequenceEqual(async); + + AssertSql( + """ +@byteArrayParam='0xDEADBEEF' + +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE b."ByteArray" = @byteArrayParam +"""); + } + + private void AssertSql(params string[] expected) + => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); +} diff --git a/test/EFCore.PG.FunctionalTests/Query/Translations/GuidTranslationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Translations/GuidTranslationsNpgsqlTest.cs new file mode 100644 index 000000000..664e1b369 --- /dev/null +++ b/test/EFCore.PG.FunctionalTests/Query/Translations/GuidTranslationsNpgsqlTest.cs @@ -0,0 +1,76 @@ +namespace Microsoft.EntityFrameworkCore.Query.Translations; + +public class GuidTranslationsNpgsqlTest : GuidTranslationsTestBase +{ + // ReSharper disable once UnusedParameter.Local + public GuidTranslationsNpgsqlTest(BasicTypesQueryNpgsqlFixture fixture, ITestOutputHelper testOutputHelper) + : base(fixture) + { + Fixture.TestSqlLoggerFactory.Clear(); + Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper); + } + + public override async Task New_with_constant(bool async) + { + await base.New_with_constant(async); + + AssertSql( + """ +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE b."Guid" = 'df36f493-463f-4123-83f9-6b135deeb7ba' +"""); + } + + public override async Task New_with_parameter(bool async) + { + await base.New_with_parameter(async); + + AssertSql( + """ +@p='df36f493-463f-4123-83f9-6b135deeb7ba' + +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE b."Guid" = @p +"""); + } + + public override async Task ToString_projection(bool async) + { + await base.ToString_projection(async); + + AssertSql( + """ +SELECT b."Guid"::text +FROM "BasicTypesEntities" AS b +"""); + } + + public override async Task NewGuid(bool async) + { + await base.NewGuid(async); + + if (TestEnvironment.PostgresVersion >= new Version(13, 0)) + { + AssertSql( + """ +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE gen_random_uuid() <> '00000000-0000-0000-0000-000000000000' +"""); + } + else + { + AssertSql( + """ +SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" +FROM "BasicTypesEntities" AS b +WHERE uuid_generate_v4() <> '00000000-0000-0000-0000-000000000000' +"""); + } + } + + private void AssertSql(params string[] expected) + => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); +} diff --git a/test/EFCore.PG.FunctionalTests/Query/Translations/MiscellaneousTranslationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Translations/MiscellaneousTranslationsNpgsqlTest.cs index 0db66fd03..3de139582 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Translations/MiscellaneousTranslationsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Translations/MiscellaneousTranslationsNpgsqlTest.cs @@ -11,163 +11,6 @@ public MiscellaneousTranslationsNpgsqlTest(BasicTypesQueryNpgsqlFixture fixture, Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper); } - #region Guid - - public override async Task Guid_new_with_constant(bool async) - { - await base.Guid_new_with_constant(async); - - AssertSql( - """ -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE b."Guid" = 'df36f493-463f-4123-83f9-6b135deeb7ba' -"""); - } - - public override async Task Guid_new_with_parameter(bool async) - { - await base.Guid_new_with_parameter(async); - - AssertSql( - """ -@p='df36f493-463f-4123-83f9-6b135deeb7ba' - -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE b."Guid" = @p -"""); - } - - public override async Task Guid_ToString_projection(bool async) - { - await base.Guid_ToString_projection(async); - - AssertSql( - """ -SELECT b."Guid"::text -FROM "BasicTypesEntities" AS b -"""); - } - - public override async Task Guid_NewGuid(bool async) - { - await base.Guid_NewGuid(async); - - if (TestEnvironment.PostgresVersion >= new Version(13, 0)) - { - AssertSql( - """ -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE gen_random_uuid() <> '00000000-0000-0000-0000-000000000000' -"""); - } - else - { - AssertSql( - """ -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE uuid_generate_v4() <> '00000000-0000-0000-0000-000000000000' -"""); - } - } - - #endregion Guid - - #region Byte array - - public override async Task Byte_array_Length(bool async) - { - await base.Byte_array_Length(async); - - AssertSql( - """ -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE length(b."ByteArray") = 4 -"""); - } - - public override async Task Byte_array_array_index(bool async) - { - await base.Byte_array_array_index(async); - - AssertSql( - """ -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE length(b."ByteArray") >= 3 AND get_byte(b."ByteArray", 2) = 190 -"""); - } - - public override async Task Byte_array_First(bool async) - { - await base.Byte_array_First(async); - - AssertSql( - """ -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE length(b."ByteArray") >= 1 AND get_byte(b."ByteArray", 0)::smallint = 222 -"""); - } - - public override async Task Byte_array_Contains_with_constant(bool async) - { - await base.Byte_array_Contains_with_constant(async); - - AssertSql( - """ -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE position(BYTEA E'\\x01' IN b."ByteArray") > 0 -"""); - } - - public override async Task Byte_array_Contains_with_parameter(bool async) - { - await base.Byte_array_Contains_with_parameter(async); - - AssertSql( - """ -@someByte='1' (DbType = Int16) - -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE position(set_byte(BYTEA E'\\x00', 0, @someByte) IN b."ByteArray") > 0 -"""); - } - - public override async Task Byte_array_Contains_with_column(bool async) - { - await base.Byte_array_Contains_with_column(async); - - AssertSql( - """ -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE position(set_byte(BYTEA E'\\x00', 0, b."Byte") IN b."ByteArray") > 0 -"""); - } - - public override async Task Byte_array_SequenceEqual(bool async) - { - await base.Byte_array_SequenceEqual(async); - - AssertSql( - """ -@byteArrayParam='0xDEADBEEF' - -SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" -FROM "BasicTypesEntities" AS b -WHERE b."ByteArray" = @byteArrayParam -"""); - } - - #endregion Byte array - #region Random public override async Task Random_on_EF_Functions(bool async)